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