Patchwork [6,of,9] subrepo: drop the 'ui' parameter to cat()

login
register
mail settings
Submitter Matt Harbison
Date Dec. 15, 2014, 1:12 a.m.
Message ID <0b545aeba85f730420b1.1418605963@Envy>
Download mbox | patch
Permalink /patch/7107/
State Accepted
Headers show

Comments

Matt Harbison - Dec. 15, 2014, 1:12 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1418498798 18000
#      Sat Dec 13 14:26:38 2014 -0500
# Node ID 0b545aeba85f730420b1d8bf1e0a4b9ea75efe86
# Parent  3383f4fbc4d632ccbc2d5aabc2da2bbcf888c016
subrepo: drop the 'ui' parameter to cat()

This no longer needs to be explicitly passed because the subrepo object tracks
a 'ui' reference since fcbc66b5da6a.  See the change to 'archive' for details
about the differences between the output level in the root repo and subrepo 'ui'
object.

The only use for 'ui' in cat is to emit a status message when a subrepo is
missing.  The bad() method on the matcher still uses the root repo's ui, because
narrowing the matcher doesn't change the ui object.

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -2182,7 +2182,7 @@ 
         try:
             submatch = matchmod.narrowmatcher(subpath, matcher)
 
-            if not sub.cat(ui, submatch, os.path.join(prefix, sub._path),
+            if not sub.cat(submatch, os.path.join(prefix, sub._path),
                            **opts):
                 err = 0
         except error.RepoLookupError:
diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
--- a/mercurial/subrepo.py
+++ b/mercurial/subrepo.py
@@ -442,7 +442,7 @@ 
         self.ui.warn("%s: %s" % (prefix, _("addremove is not supported")))
         return 1
 
-    def cat(self, ui, match, prefix, **opts):
+    def cat(self, match, prefix, **opts):
         return 1
 
     def status(self, rev2, **opts):
@@ -636,10 +636,10 @@ 
                                  dry_run, similarity)
 
     @annotatesubrepoerror
-    def cat(self, ui, match, prefix, **opts):
+    def cat(self, match, prefix, **opts):
         rev = self._state[1]
         ctx = self._repo[rev]
-        return cmdutil.cat(ui, self._repo, ctx, match, prefix, **opts)
+        return cmdutil.cat(self.ui, self._repo, ctx, match, prefix, **opts)
 
     @annotatesubrepoerror
     def status(self, rev2, **opts):