##// END OF EJS Templates
stack: use repo.revs() instead of revsetlang.formatspec() + scmutil.revrange()...
av6 -
r43230:763028fc default
parent child Browse files
Show More
@@ -1,29 +1,23 b''
1 1 # stack.py - Mercurial functions for stack definition
2 2 #
3 3 # Copyright Matt Mackall <mpm@selenic.com> and other
4 4 #
5 5 # This software may be used and distributed according to the terms of the
6 6 # GNU General Public License version 2 or any later version.
7 7
8 8 from __future__ import absolute_import
9 9
10 from . import (
11 revsetlang,
12 scmutil,
13 )
14
15 10 def getstack(repo, rev=None):
16 11 """return a sorted smartrev of the stack containing either rev if it is
17 12 not None or the current working directory parent.
18 13
19 14 The stack will always contain all drafts changesets which are ancestors to
20 15 the revision and are not merges.
21 16 """
22 17 if rev is None:
23 18 rev = '.'
24 19
25 20 revspec = 'only(%s) and not public() and not ::merge()'
26 revset = revsetlang.formatspec(revspec, rev)
27 revisions = scmutil.revrange(repo, [revset])
21 revisions = repo.revs(revspec, rev)
28 22 revisions.sort()
29 23 return revisions
General Comments 0
You need to be logged in to leave comments. Login now