changeset 42960:763028fc6a69

stack: use repo.revs() instead of revsetlang.formatspec() + scmutil.revrange() Using scmutil.revrange() it's possible to use multiple revsets at the same time, but we're not using that functionality in stack. I thought maybe that function could be used to make stack definition customizable (by combining various parts into one set), but scmutil.revrange() gives the union of all provided revsets, which is not very useful in stack's case (we want "and" between parts, not "or").
author Anton Shestakov <av6@dwimlabs.net>
date Sun, 22 Sep 2019 14:33:56 +0700
parents af2b5562fcaf
children 460f8bf58020
files mercurial/stack.py
diffstat 1 files changed, 1 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/stack.py	Mon Sep 23 21:29:53 2019 +0900
+++ b/mercurial/stack.py	Sun Sep 22 14:33:56 2019 +0700
@@ -7,11 +7,6 @@
 
 from __future__ import absolute_import
 
-from . import (
-    revsetlang,
-    scmutil,
-)
-
 def getstack(repo, rev=None):
     """return a sorted smartrev of the stack containing either rev if it is
     not None or the current working directory parent.
@@ -23,7 +18,6 @@
         rev = '.'
 
     revspec = 'only(%s) and not public() and not ::merge()'
-    revset = revsetlang.formatspec(revspec, rev)
-    revisions = scmutil.revrange(repo, [revset])
+    revisions = repo.revs(revspec, rev)
     revisions.sort()
     return revisions