changeset 14743:84a680daa4b2 stable

dispatch: pass the correct ui to runcommand For commands that take a repo, repo.ui is passed as the ui to runcommand. This restores that behaviour when the request has a repo.
author Idan Kamara <idankk86@gmail.com>
date Fri, 24 Jun 2011 19:36:44 +0300
parents 271424fdbeec
children 23325c5ef6a7
files mercurial/dispatch.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dispatch.py	Fri Jun 24 17:04:37 2011 +0300
+++ b/mercurial/dispatch.py	Fri Jun 24 19:36:44 2011 +0300
@@ -625,10 +625,9 @@
         if not repo:
             try:
                 repo = hg.repository(ui, path=path)
-                ui = repo.ui
                 if not repo.local():
                     raise util.Abort(_("repository '%s' is not local") % path)
-                ui.setconfig("bundle", "mainreporoot", repo.root)
+                repo.ui.setconfig("bundle", "mainreporoot", repo.root)
             except error.RequirementError:
                 raise
             except error.RepoError:
@@ -643,6 +642,8 @@
                         raise error.RepoError(_("no repository found in %r"
                                                 " (.hg not found)") % os.getcwd())
                     raise
+        if repo:
+            ui = repo.ui
         args.insert(0, repo)
     elif rpath:
         ui.warn(_("warning: --repository ignored\n"))