Commits

Augie Fackler  committed e2af8ce

updatedir: handle move of updatedir from cmdutil to scmutil

  • Participants
  • Parent commits f5feed5

Comments (0)

Files changed (1)

File hg_histedit.py

 from mercurial import discovery
 from mercurial.i18n import _
 
-# Remove this hack and use cmdutil.updatedir when we're 1.7-only
 def _revsingle(repo, parent):
     return repo[parent]
 _revsingle = getattr(cmdutil, 'revsingle', _revsingle)
 else:
     from mercurial.cmdutil import bail_if_changed as bailifchanged
 
-# Remove this hack and use cmdutil.updatedir when we're 1.7-only
-if getattr(cmdutil, 'updatedir', None):
-    from mercurial.cmdutil import updatedir
-else:
-    from mercurial.patch import updatedir
+# hg < 1.7
+updatedir = getattr(patch, 'updatedir', None)
+if updatedir is None:
+    # hg >= 1.7
+    updatedir = getattr(cmdutil, 'updatedir', None)
+if updatedir is None:
+    # hg >= 1.9
+    from mercurial.scmutil import updatedir
+
 
 try:
     hidepassword = util.hidepassword