diff hgsubversion/util.py @ 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 cb32d90f915e
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: