diff mercurial/destutil.py @ 31045:6cf2857526c7

scmutil: proxy revrange() through repo to break import cycles This was one of the hardest import cycles as scmutil is widely used and revset functions are likely to depend on a variety of modules. New repo.anyrevs() does not expand user aliases by default to copy the behavior of the existing repo.revs(). I don't want to add new function to localrepository, but this function is quite similar to repo.revs() so it won't increase the complexity of the localrepository class so much.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 19 Feb 2017 20:00:18 +0900
parents 11c253997b0e
children b9942bc6b292
line wrap: on
line diff
--- a/mercurial/destutil.py	Sun Feb 19 18:19:33 2017 +0900
+++ b/mercurial/destutil.py	Sun Feb 19 20:00:18 2017 +0900
@@ -12,6 +12,7 @@
     bookmarks,
     error,
     obsolete,
+    scmutil,
 )
 
 def _destupdateobs(repo, clean):
@@ -342,9 +343,6 @@
 
 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 = scmutil.revrange(repo, [default])