Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/obsutil.py @ 43588:c8f1e8412db4
index: use `index.has_node` in `obsutil.exclusivemarkers`
Differential Revision: https://phab.mercurial-scm.org/D7333
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Fri, 08 Nov 2019 14:19:53 +0100 |
parents | 8ff1ecfadcd1 |
children | 1944aaaecabf |
comparison
equal
deleted
inserted
replaced
43587:44f54b8f9f10 | 43588:c8f1e8412db4 |
---|---|
247 # running on a filtered repository would be dangerous as markers could be | 247 # running on a filtered repository would be dangerous as markers could be |
248 # reported as exclusive when they are relevant for other filtered nodes. | 248 # reported as exclusive when they are relevant for other filtered nodes. |
249 unfi = repo.unfiltered() | 249 unfi = repo.unfiltered() |
250 | 250 |
251 # shortcut to various useful item | 251 # shortcut to various useful item |
252 nm = unfi.changelog.nodemap | 252 has_node = unfi.changelog.index.has_node |
253 precursorsmarkers = unfi.obsstore.predecessors | 253 precursorsmarkers = unfi.obsstore.predecessors |
254 successormarkers = unfi.obsstore.successors | 254 successormarkers = unfi.obsstore.successors |
255 childrenmarkers = unfi.obsstore.children | 255 childrenmarkers = unfi.obsstore.children |
256 | 256 |
257 # exclusive markers (return of the function) | 257 # exclusive markers (return of the function) |
295 # nodes in the stack or already processed | 295 # nodes in the stack or already processed |
296 if prec in seennodes: | 296 if prec in seennodes: |
297 continue | 297 continue |
298 | 298 |
299 # is this a locally known node ? | 299 # is this a locally known node ? |
300 known = prec in nm | 300 known = has_node(prec) |
301 # if locally-known and not in the <nodes> set the traversal | 301 # if locally-known and not in the <nodes> set the traversal |
302 # stop here. | 302 # stop here. |
303 if known and prec not in nodes: | 303 if known and prec not in nodes: |
304 continue | 304 continue |
305 | 305 |