wrappers: cope with remoteui move to hg (hg cset 1d4f3581cbe5)

This commit is contained in:
Augie Fackler 2010-06-13 00:10:53 -05:00
parent f18467bb2a
commit 747d8b134a
2 changed files with 7 additions and 1 deletions

View File

@ -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:

View File

@ -383,7 +383,7 @@ def clone(orig, ui, source, dest=None, **opts):
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'),