changeset 620:8acae2416ec1

wrappers: cope with remoteui move to hg (hg cset d1908cb95a82)
author Augie Fackler <durin42@gmail.com>
date Sun, 13 Jun 2010 00:10:53 -0500
parents 8beb5e28c23b
children 3e18cdcb6e00
files hgsubversion/util.py hgsubversion/wrappers.py
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgsubversion/util.py
+++ b/hgsubversion/util.py
@@ -2,6 +2,7 @@ import re
 import os
 import urllib
 
+from mercurial import cmdutil
 from mercurial import hg
 from mercurial import node
 from mercurial import util as hgutil
@@ -89,6 +90,11 @@ def progress(ui, *args, **kwargs):
     if getattr(ui, 'progress', False):
         return ui.progress(*args, **kwargs)
 
+# TODO remove when we drop 1.5 support
+remoteui = getattr(cmdutil, 'remoteui', getattr(hg, 'remoteui', False))
+if not remoteui:
+    raise ImportError('Failed to import remoteui')
+
 def parseurl(url, heads=[]):
     parsed = hg.parseurl(url, heads)
     if len(parsed) == 3:
--- a/hgsubversion/wrappers.py
+++ b/hgsubversion/wrappers.py
@@ -383,7 +383,7 @@ def clone(orig, ui, source, dest=None, *
             ui.setconfig(section, name, str(opts.pop(opt)))
 
     # this must be kept in sync with mercurial/commands.py
-    srcrepo, dstrepo = hg.clone(cmdutil.remoteui(ui, opts), source, dest,
+    srcrepo, dstrepo = hg.clone(util.remoteui(ui, opts), source, dest,
                                 pull=opts.get('pull'),
                                 stream=opts.get('uncompressed'),
                                 rev=opts.get('rev'),