Show More
@@ -208,7 +208,7 b' class phasecache(object):' | |||
|
208 | 208 | self.filterunknown(repo) |
|
209 | 209 | self.opener = repo.svfs |
|
210 | 210 | |
|
211 | def getrevset(self, repo, phases): | |
|
211 | def getrevset(self, repo, phases, subset=None): | |
|
212 | 212 | """return a smartset for the given phases""" |
|
213 | 213 | self.loadphaserevs(repo) # ensure phase's sets are loaded |
|
214 | 214 | phases = set(phases) |
@@ -222,7 +222,10 b' class phasecache(object):' | |||
|
222 | 222 | revs = set.union(*[self._phasesets[p] for p in phases]) |
|
223 | 223 | if repo.changelog.filteredrevs: |
|
224 | 224 | revs = revs - repo.changelog.filteredrevs |
|
225 | return smartset.baseset(revs) | |
|
225 | if subset is None: | |
|
226 | return smartset.baseset(revs) | |
|
227 | else: | |
|
228 | return subset & smartset.baseset(revs) | |
|
226 | 229 | else: |
|
227 | 230 | phases = set(allphases).difference(phases) |
|
228 | 231 | if not phases: |
@@ -232,9 +235,11 b' class phasecache(object):' | |||
|
232 | 235 | revs = self._phasesets[p] |
|
233 | 236 | else: |
|
234 | 237 | revs = set.union(*[self._phasesets[p] for p in phases]) |
|
238 | if subset is None: | |
|
239 | subset = smartset.fullreposet(repo) | |
|
235 | 240 | if not revs: |
|
236 |
return s |
|
|
237 |
return s |
|
|
241 | return subset | |
|
242 | return subset.filter(lambda r: r not in revs) | |
|
238 | 243 | |
|
239 | 244 | def copy(self): |
|
240 | 245 | # Shallow copy meant to ensure isolation in |
@@ -1504,8 +1504,7 b' def parents(repo, subset, x):' | |||
|
1504 | 1504 | |
|
1505 | 1505 | def _phase(repo, subset, *targets): |
|
1506 | 1506 | """helper to select all rev in <targets> phases""" |
|
1507 |
|
|
|
1508 | return subset & s | |
|
1507 | return repo._phasecache.getrevset(repo, targets, subset) | |
|
1509 | 1508 | |
|
1510 | 1509 | @predicate('draft()', safe=True) |
|
1511 | 1510 | def draft(repo, subset, x): |
@@ -1612,11 +1611,7 b' def public(repo, subset, x):' | |||
|
1612 | 1611 | """Changeset in public phase.""" |
|
1613 | 1612 | # i18n: "public" is a keyword |
|
1614 | 1613 | getargs(x, 0, 0, _("public takes no arguments")) |
|
1615 | phase = repo._phasecache.phase | |
|
1616 | target = phases.public | |
|
1617 | condition = lambda r: phase(repo, r) == target | |
|
1618 | return subset.filter(condition, condrepr=('<phase %r>', target), | |
|
1619 | cache=False) | |
|
1614 | return _phase(repo, subset, phases.public) | |
|
1620 | 1615 | |
|
1621 | 1616 | @predicate('remote([id [,path]])', safe=False) |
|
1622 | 1617 | def remote(repo, subset, x): |
General Comments 0
You need to be logged in to leave comments.
Login now