changeset 27559:d13bcc9fd656

destutil: use scmutil.revrange for desthistedit (issue5001) This allows user aliases to be expanded. It also prevents the user-provided revset from being treated as a revset expression.
author Gregory Szorc <gregory.szorc@gmail.com>
date Thu, 24 Dec 2015 10:16:30 -0800
parents b5b54825de6b
children 15b06f306c1f
files mercurial/destutil.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/destutil.py	Fri Dec 18 13:53:50 2015 -0600
+++ b/mercurial/destutil.py	Thu Dec 24 10:16:30 2015 -0800
@@ -205,9 +205,12 @@
 
 def desthistedit(ui, repo):
     """Default base revision to edit for `hg histedit`."""
+    # Avoid cycle: scmutil -> revset -> destutil
+    from . import scmutil
+
     default = ui.config('histedit', 'defaultrev', histeditdefaultrevset)
     if default:
-        revs = repo.revs(default)
+        revs = scmutil.revrange(repo, [default])
         if revs:
             # The revset supplied by the user may not be in ascending order nor
             # take the first revision. So do this manually.