Show More
@@ -47,30 +47,6 b' def revealedrevs(repo):' | |||||
47 | blockers.update(rev(t[0]) for t in tags.values() if t[0] in nodemap) |
|
47 | blockers.update(rev(t[0]) for t in tags.values() if t[0] in nodemap) | |
48 | return blockers |
|
48 | return blockers | |
49 |
|
49 | |||
50 | def _getstatichidden(repo): |
|
|||
51 | """Revision to be hidden (disregarding dynamic blocker) |
|
|||
52 |
|
||||
53 | To keep a consistent graph, we cannot hide any revisions with |
|
|||
54 | non-hidden descendants. This function computes the set of |
|
|||
55 | revisions that could be hidden while keeping the graph consistent. |
|
|||
56 |
|
||||
57 | A second pass will be done to apply "dynamic blocker" like bookmarks or |
|
|||
58 | working directory parents. |
|
|||
59 |
|
||||
60 | """ |
|
|||
61 | assert not repo.changelog.filteredrevs |
|
|||
62 | hidden = hideablerevs(repo) |
|
|||
63 | if hidden: |
|
|||
64 | pfunc = repo.changelog.parentrevs |
|
|||
65 |
|
||||
66 | mutablephases = (phases.draft, phases.secret) |
|
|||
67 | mutable = repo._phasecache.getrevset(repo, mutablephases) |
|
|||
68 | blockers = _consistencyblocker(pfunc, hidden, mutable) |
|
|||
69 |
|
||||
70 | if blockers: |
|
|||
71 | hidden = hidden - _domainancestors(pfunc, blockers, mutable) |
|
|||
72 | return hidden |
|
|||
73 |
|
||||
74 | def _consistencyblocker(pfunc, hideable, domain): |
|
50 | def _consistencyblocker(pfunc, hideable, domain): | |
75 | """return non-hideable changeset blocking hideable one |
|
51 | """return non-hideable changeset blocking hideable one | |
76 |
|
52 | |||
@@ -129,21 +105,20 b' def computehidden(repo):' | |||||
129 | During most operation hidden should be filtered.""" |
|
105 | During most operation hidden should be filtered.""" | |
130 | assert not repo.changelog.filteredrevs |
|
106 | assert not repo.changelog.filteredrevs | |
131 |
|
107 | |||
132 | hidden = frozenset() |
|
108 | hidden = hideablerevs(repo) | |
133 | hideable = hideablerevs(repo) |
|
109 | if hidden: | |
134 | if hideable: |
|
110 | pfunc = repo.changelog.parentrevs | |
135 | cl = repo.changelog |
|
111 | mutablephases = (phases.draft, phases.secret) | |
136 | hidden = frozenset(_getstatichidden(repo)) |
|
112 | mutable = repo._phasecache.getrevset(repo, mutablephases) | |
|
113 | ||||
|
114 | blockers = _consistencyblocker(pfunc, hidden, mutable) | |||
137 |
|
115 | |||
138 | # check if we have wd parents, bookmarks or tags pointing to hidden |
|
116 | # check if we have wd parents, bookmarks or tags pointing to hidden | |
139 | # changesets and remove those. |
|
117 | # changesets and remove those. | |
140 |
|
|
118 | blockers |= (hidden & revealedrevs(repo)) | |
141 |
if |
|
119 | if blockers: | |
142 | pfunc = cl.parentrevs |
|
120 | hidden = hidden - _domainancestors(pfunc, blockers, mutable) | |
143 | mutablephases = (phases.draft, phases.secret) |
|
121 | return frozenset(hidden) | |
144 | mutable = repo._phasecache.getrevset(repo, mutablephases) |
|
|||
145 | hidden = hidden - _domainancestors(pfunc, dynamic, mutable) |
|
|||
146 | return hidden |
|
|||
147 |
|
122 | |||
148 | def computeunserved(repo): |
|
123 | def computeunserved(repo): | |
149 | """compute the set of revision that should be filtered when used a server |
|
124 | """compute the set of revision that should be filtered when used a server |
General Comments 0
You need to be logged in to leave comments.
Login now