use ui instead of repo.ui when the former is in scope
authorMartin Geisler <mg@lazybytes.net>
Sun, 24 May 2009 22:37:20 +0200
changeset 8615 94ca38e63576
parent 8614 573734e7e6d0
child 8616 704833724ff6
use ui instead of repo.ui when the former is in scope
hgext/hgk.py
hgext/rebase.py
hgext/transplant.py
mercurial/commands.py
mercurial/filemerge.py
--- a/hgext/hgk.py	Sun May 24 16:38:29 2009 -0500
+++ b/hgext/hgk.py	Sun May 24 22:37:20 2009 +0200
@@ -96,7 +96,7 @@
             chunks = patch.diff(repo, node1, node2, match=m,
                                 opts=patch.diffopts(ui, {'git': True}))
             for chunk in chunks:
-                repo.ui.write(chunk)
+                ui.write(chunk)
         else:
             __difftree(repo, node1, node2, files=files)
         if not opts['stdin']:
--- a/hgext/rebase.py	Sun May 24 16:38:29 2009 -0500
+++ b/hgext/rebase.py	Sun May 24 22:37:20 2009 +0200
@@ -96,7 +96,7 @@
             if result:
                 originalwd, target, state, external = result
             else: # Empty state built, nothing to rebase
-                repo.ui.status(_('nothing to rebase\n'))
+                ui.status(_('nothing to rebase\n'))
                 return
 
         if keepbranchesf:
@@ -133,7 +133,7 @@
                 ui.warn(_("warning: new changesets detected on source branch, "
                                                         "not stripping\n"))
             else:
-                repair.strip(repo.ui, repo, repo[min(state)].node(), "strip")
+                repair.strip(ui, repo, repo[min(state)].node(), "strip")
 
         clearstatus(repo)
         ui.status(_("rebase completed\n"))
--- a/hgext/transplant.py	Sun May 24 16:38:29 2009 -0500
+++ b/hgext/transplant.py	Sun May 24 22:37:20 2009 +0200
@@ -413,7 +413,7 @@
             elif action == 'p':
                 parent = repo.changelog.parents(node)[0]
                 for chunk in patch.diff(repo, parent, node):
-                    repo.ui.write(chunk)
+                    ui.write(chunk)
                 action = None
             elif action not in ('y', 'n', 'm', 'c', 'q'):
                 ui.write('no such option\n')
--- a/mercurial/commands.py	Sun May 24 16:38:29 2009 -0500
+++ b/mercurial/commands.py	Sun May 24 22:37:20 2009 +0200
@@ -1078,7 +1078,7 @@
     m = cmdutil.match(repo, pats, opts)
     it = patch.diff(repo, node1, node2, match=m, opts=patch.diffopts(ui, opts))
     for chunk in it:
-        repo.ui.write(chunk)
+        ui.write(chunk)
 
 def export(ui, repo, *changesets, **opts):
     """dump the header and diffs for one or more changesets
@@ -2491,7 +2491,7 @@
             for f in names:
                 if f.startswith(path_):
                     return False
-            repo.ui.warn("%s: %s\n" % (m.rel(path), msg))
+            ui.warn("%s: %s\n" % (m.rel(path), msg))
             return False
 
         m = cmdutil.match(repo, pats, opts)
--- a/mercurial/filemerge.py	Sun May 24 16:38:29 2009 -0500
+++ b/mercurial/filemerge.py	Sun May 24 22:37:20 2009 +0200
@@ -163,11 +163,11 @@
     util.copyfile(a, back)
 
     if orig != fco.path():
-        repo.ui.status(_("merging %s and %s to %s\n") % (orig, fco.path(), fd))
+        ui.status(_("merging %s and %s to %s\n") % (orig, fco.path(), fd))
     else:
-        repo.ui.status(_("merging %s\n") % fd)
+        ui.status(_("merging %s\n") % fd)
 
-    repo.ui.debug(_("my %s other %s ancestor %s\n") % (fcd, fco, fca))
+    ui.debug(_("my %s other %s ancestor %s\n") % (fcd, fco, fca))
 
     # do we attempt to simplemerge first?
     if _toolbool(ui, tool, "premerge", not (binary or symlink)):
@@ -213,7 +213,7 @@
         _matcheol(repo.wjoin(fd), back)
 
     if r:
-        repo.ui.warn(_("merging %s failed!\n") % fd)
+        ui.warn(_("merging %s failed!\n") % fd)
     else:
         os.unlink(back)