comparison mercurial/repoview.py @ 32591:2af0b9a02bf9

hidden: make _revealancestors() reveal ancestors exclusively I think this seems more expected. It also prepares for the next commit.
author Martin von Zweigbergk <martinvonz@google.com>
date Sat, 27 May 2017 23:05:10 -0700
parents c777dac2b27c
children c37ca35b8450
comparison
equal deleted inserted replaced
32590:c777dac2b27c 32591:2af0b9a02bf9
51 51
52 - pfunc(r): a funtion returning parent of 'r', 52 - pfunc(r): a funtion returning parent of 'r',
53 - hidden: the (preliminary) hidden revisions, to be updated 53 - hidden: the (preliminary) hidden revisions, to be updated
54 - revs: iterable of revnum, 54 - revs: iterable of revnum,
55 55
56 (Ancestors are revealed inclusively, i.e. the elements in 'revs' are 56 (Ancestors are revealed exclusively, i.e. the elements in 'revs' are
57 also revealed) 57 *not* revealed)
58 """ 58 """
59 stack = list(revs) 59 stack = list(revs)
60 hidden -= set(stack)
61 while stack: 60 while stack:
62 for p in pfunc(stack.pop()): 61 for p in pfunc(stack.pop()):
63 if p != nullrev and p in hidden: 62 if p != nullrev and p in hidden:
64 hidden.remove(p) 63 hidden.remove(p)
65 stack.append(p) 64 stack.append(p)
77 mutable = repo._phasecache.getrevset(repo, mutablephases) 76 mutable = repo._phasecache.getrevset(repo, mutablephases)
78 77
79 visible = set(mutable - hidden) 78 visible = set(mutable - hidden)
80 visible |= (hidden & pinnedrevs(repo)) 79 visible |= (hidden & pinnedrevs(repo))
81 if visible: 80 if visible:
82 # don't modify possibly cached result of hideablerevs() 81 hidden = hidden - visible
83 hidden = hidden.copy()
84 _revealancestors(pfunc, hidden, visible) 82 _revealancestors(pfunc, hidden, visible)
85 return frozenset(hidden) 83 return frozenset(hidden)
86 84
87 def computeunserved(repo): 85 def computeunserved(repo):
88 """compute the set of revision that should be filtered when used a server 86 """compute the set of revision that should be filtered when used a server