Show More
@@ -65,7 +65,7 b' def _revealancestors(pfunc, hidden, revs' | |||||
65 | hidden.remove(p) |
|
65 | hidden.remove(p) | |
66 | stack.append(p) |
|
66 | stack.append(p) | |
67 |
|
67 | |||
68 | def computehidden(repo): |
|
68 | def computehidden(repo, visibilityexceptions=None): | |
69 | """compute the set of hidden revision to filter |
|
69 | """compute the set of hidden revision to filter | |
70 |
|
70 | |||
71 | During most operation hidden should be filtered.""" |
|
71 | During most operation hidden should be filtered.""" | |
@@ -74,6 +74,8 b' def computehidden(repo):' | |||||
74 | hidden = hideablerevs(repo) |
|
74 | hidden = hideablerevs(repo) | |
75 | if hidden: |
|
75 | if hidden: | |
76 | hidden = set(hidden - pinnedrevs(repo)) |
|
76 | hidden = set(hidden - pinnedrevs(repo)) | |
|
77 | if visibilityexceptions: | |||
|
78 | hidden -= visibilityexceptions | |||
77 | pfunc = repo.changelog.parentrevs |
|
79 | pfunc = repo.changelog.parentrevs | |
78 | mutablephases = (phases.draft, phases.secret) |
|
80 | mutablephases = (phases.draft, phases.secret) | |
79 | mutable = repo._phasecache.getrevset(repo, mutablephases) |
|
81 | mutable = repo._phasecache.getrevset(repo, mutablephases) | |
@@ -82,7 +84,7 b' def computehidden(repo):' | |||||
82 | _revealancestors(pfunc, hidden, visible) |
|
84 | _revealancestors(pfunc, hidden, visible) | |
83 | return frozenset(hidden) |
|
85 | return frozenset(hidden) | |
84 |
|
86 | |||
85 | def computeunserved(repo): |
|
87 | def computeunserved(repo, visibilityexceptions=None): | |
86 | """compute the set of revision that should be filtered when used a server |
|
88 | """compute the set of revision that should be filtered when used a server | |
87 |
|
89 | |||
88 | Secret and hidden changeset should not pretend to be here.""" |
|
90 | Secret and hidden changeset should not pretend to be here.""" | |
@@ -100,7 +102,7 b' def computeunserved(repo):' | |||||
100 | else: |
|
102 | else: | |
101 | return hiddens |
|
103 | return hiddens | |
102 |
|
104 | |||
103 | def computemutable(repo): |
|
105 | def computemutable(repo, visibilityexceptions=None): | |
104 | assert not repo.changelog.filteredrevs |
|
106 | assert not repo.changelog.filteredrevs | |
105 | # fast check to avoid revset call on huge repo |
|
107 | # fast check to avoid revset call on huge repo | |
106 | if any(repo._phasecache.phaseroots[1:]): |
|
108 | if any(repo._phasecache.phaseroots[1:]): | |
@@ -109,7 +111,7 b' def computemutable(repo):' | |||||
109 | return frozenset(r for r in maymutable if getphase(repo, r)) |
|
111 | return frozenset(r for r in maymutable if getphase(repo, r)) | |
110 | return frozenset() |
|
112 | return frozenset() | |
111 |
|
113 | |||
112 | def computeimpactable(repo): |
|
114 | def computeimpactable(repo, visibilityexceptions=None): | |
113 | """Everything impactable by mutable revision |
|
115 | """Everything impactable by mutable revision | |
114 |
|
116 | |||
115 | The immutable filter still have some chance to get invalidated. This will |
|
117 | The immutable filter still have some chance to get invalidated. This will | |
@@ -145,10 +147,16 b" filtertable = {'visible': computehidden," | |||||
145 | 'immutable': computemutable, |
|
147 | 'immutable': computemutable, | |
146 | 'base': computeimpactable} |
|
148 | 'base': computeimpactable} | |
147 |
|
149 | |||
148 | def filterrevs(repo, filtername): |
|
150 | def filterrevs(repo, filtername, visibilityexceptions=None): | |
149 |
"""returns set of filtered revision for this filter name |
|
151 | """returns set of filtered revision for this filter name | |
|
152 | ||||
|
153 | visibilityexceptions is a set of revs which must are exceptions for | |||
|
154 | hidden-state and must be visible. They are dynamic and hence we should not | |||
|
155 | cache it's result""" | |||
150 | if filtername not in repo.filteredrevcache: |
|
156 | if filtername not in repo.filteredrevcache: | |
151 | func = filtertable[filtername] |
|
157 | func = filtertable[filtername] | |
|
158 | if visibilityexceptions: | |||
|
159 | return func(repo.unfiltered, visibilityexceptions) | |||
152 | repo.filteredrevcache[filtername] = func(repo.unfiltered()) |
|
160 | repo.filteredrevcache[filtername] = func(repo.unfiltered()) | |
153 | return repo.filteredrevcache[filtername] |
|
161 | return repo.filteredrevcache[filtername] | |
154 |
|
162 | |||
@@ -210,7 +218,7 b' class repoview(object):' | |||||
210 | unfilen = len(unfiindex) - 1 |
|
218 | unfilen = len(unfiindex) - 1 | |
211 | unfinode = unfiindex[unfilen - 1][7] |
|
219 | unfinode = unfiindex[unfilen - 1][7] | |
212 |
|
220 | |||
213 | revs = filterrevs(unfi, self.filtername) |
|
221 | revs = filterrevs(unfi, self.filtername, self._visibilityexceptions) | |
214 | cl = self._clcache |
|
222 | cl = self._clcache | |
215 | newkey = (unfilen, unfinode, hash(revs), unfichangelog._delayed) |
|
223 | newkey = (unfilen, unfinode, hash(revs), unfichangelog._delayed) | |
216 | # if cl.index is not unfiindex, unfi.changelog would be |
|
224 | # if cl.index is not unfiindex, unfi.changelog would be |
General Comments 0
You need to be logged in to leave comments.
Login now