Patchwork D5881: subrepo: avoid calculating subrepo prefix twice for cat() (API)

login
register
mail settings
Submitter phabricator
Date Feb. 9, 2019, 9:44 p.m.
Message ID <bd0a283ae007427f1fd0c0796c19d5c1@localhost.localdomain>
Download mbox | patch
Permalink /patch/38591/
State Not Applicable
Headers show

Comments

phabricator - Feb. 9, 2019, 9:44 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG93620a4ba88d: subrepo: avoid calculating subrepo prefix twice for cat() (API) (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5881?vs=13892&id=13955

REVISION DETAIL
  https://phab.mercurial-scm.org/D5881

AFFECTED FILES
  mercurial/cmdutil.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -2361,14 +2361,12 @@ 
         sub = ctx.sub(subpath)
         try:
             submatch = matchmod.subdirmatcher(subpath, matcher)
-
-            if not sub.cat(submatch, basefm, fntemplate,
-                           os.path.join(prefix, sub._path),
+            subprefix = os.path.join(prefix, sub._path)
+            if not sub.cat(submatch, basefm, fntemplate, subprefix,
                            **pycompat.strkwargs(opts)):
                 err = 0
         except error.RepoLookupError:
-            ui.status(_("skipping missing subrepository: %s\n")
-                           % os.path.join(prefix, subpath))
+            ui.status(_("skipping missing subrepository: %s\n") % subprefix)
 
     return err