[PATCH] commands: use repo.ui rather than ui when expanding the path
Dan Villiom Podlaski Christiansen
danchr at gmail.com
Fri Jul 10 07:06:33 CDT 2009
# HG changeset patch
# User Dan Villiom Podlaski Christiansen <danchr at gmail.com>
# Date 1247226048 -7200
# Node ID 675cedfd78fca2123d725dd0cf6bcbad1e7c27b2
# Parent d7881cd9bed6714ce8faabdf59003f0b85cef74a
commands: use repo.ui rather than ui when expanding the path.
This allows sessions accessing more than one repository to reuse the
UI instance.
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -524,7 +524,7 @@ def bundle(ui, repo, fname, dest=None, *
visit.append(p)
else:
dest, revs, checkout = hg.parseurl(
- ui.expandpath(dest or 'default-push', dest or 'default'), revs)
+ repo.ui.expandpath(dest or 'default-push', dest or 'default'), revs)
other = hg.repository(cmdutil.remoteui(repo, opts), dest)
o = repo.findoutgoing(other, force=opts.get('force'))
@@ -1627,7 +1627,7 @@ def identify(ui, repo, source=None,
revs = []
if source:
- source, revs, checkout = hg.parseurl(ui.expandpath(source), [])
+ source, revs, checkout = hg.parseurl(repo.ui.expandpath(source), [])
repo = hg.repository(ui, source)
if not repo.local():
@@ -1815,7 +1815,8 @@ def incoming(ui, repo, source="default",
See pull for valid source format details.
"""
limit = cmdutil.loglimit(opts)
- source, revs, checkout = hg.parseurl(ui.expandpath(source), opts.get('rev'))
+ source, revs, checkout = hg.parseurl(repo.ui.expandpath(source),
+ opts.get('rev'))
other = hg.repository(cmdutil.remoteui(repo, opts), source)
ui.status(_('comparing with %s\n') % url.hidepassword(source))
if revs:
@@ -2137,8 +2138,10 @@ def outgoing(ui, repo, dest=None, **opts
See pull for valid destination format details.
"""
limit = cmdutil.loglimit(opts)
- dest, revs, checkout = hg.parseurl(
- ui.expandpath(dest or 'default-push', dest or 'default'), opts.get('rev'))
+ dest, revs, checkout = \
+ hg.parseurl(repo.ui.expandpath(dest or 'default-push',
+ dest or 'default'), opts.get('rev'))
+
if revs:
revs = [repo.lookup(rev) for rev in revs]
@@ -2254,7 +2257,8 @@ def pull(ui, repo, source="default", **o
If SOURCE is omitted, the 'default' path will be used. See 'hg help urls'
for more information.
"""
- source, revs, checkout = hg.parseurl(ui.expandpath(source), opts.get('rev'))
+ source, revs, checkout = hg.parseurl(repo.ui.expandpath(source),
+ opts.get('rev'))
other = hg.repository(cmdutil.remoteui(repo, opts), source)
ui.status(_('pulling from %s\n') % url.hidepassword(source))
if revs:
@@ -2287,8 +2291,11 @@ def push(ui, repo, dest=None, **opts):
Please see 'hg help urls' for important details about ssh:// URLs. If
DESTINATION is omitted, a default path will be used.
"""
- dest, revs, checkout = hg.parseurl(
- ui.expandpath(dest or 'default-push', dest or 'default'), opts.get('rev'))
+ dest, revs, checkout = \
+ hg.parseurl(repo.ui.expandpath(dest or 'default-push',
+ dest or 'default'),
+ opts.get('rev'))
+
other = hg.repository(cmdutil.remoteui(repo, opts), dest)
ui.status(_('pushing to %s\n') % url.hidepassword(dest))
if revs:
More information about the Mercurial-devel
mailing list