comparison mercurial/revset.py @ 37001:407934a97bc7

stack: import Evolve stack test file Import Evolve stack test file for starting to have good coverage on stack definition. Differential Revision: https://phab.mercurial-scm.org/D2396
author Boris Feld <boris.feld@octobus.net>
date Fri, 19 Jan 2018 16:52:02 +0100
parents c6061cadb400
children f0b6fbea00cf
comparison
equal deleted inserted replaced
37000:40583c7afd63 37001:407934a97bc7
26 registrar, 26 registrar,
27 repoview, 27 repoview,
28 revsetlang, 28 revsetlang,
29 scmutil, 29 scmutil,
30 smartset, 30 smartset,
31 stack,
31 util, 32 util,
32 ) 33 )
33 from .utils import dateutil 34 from .utils import dateutil
34 35
35 # helpers for processing parsed tree 36 # helpers for processing parsed tree
1530 # i18n: "secret" is a keyword 1531 # i18n: "secret" is a keyword
1531 getargs(x, 0, 0, _("secret takes no arguments")) 1532 getargs(x, 0, 0, _("secret takes no arguments"))
1532 target = phases.secret 1533 target = phases.secret
1533 return _phase(repo, subset, target) 1534 return _phase(repo, subset, target)
1534 1535
1536 @predicate('stack([revs])', safe=True)
1537 def _stack(repo, subset, x):
1538 # experimental revset for the stack of changesets or working directory
1539 # parent
1540 if x is None:
1541 stacks = stack.getstack(repo, x)
1542 else:
1543 stacks = smartset.baseset([])
1544 for revision in getset(repo, fullreposet(repo), x):
1545 currentstack = stack.getstack(repo, revision)
1546 stacks = stacks + currentstack
1547
1548 # Force to use the order of the stacks instead of the subset one
1549 return stacks & subset
1550
1535 def parentspec(repo, subset, x, n, order): 1551 def parentspec(repo, subset, x, n, order):
1536 """``set^0`` 1552 """``set^0``
1537 The set. 1553 The set.
1538 ``set^1`` (or ``set^``), ``set^2`` 1554 ``set^1`` (or ``set^``), ``set^2``
1539 First or second parent, respectively, of all changesets in set. 1555 First or second parent, respectively, of all changesets in set.