# HG changeset patch # User Martin von Zweigbergk # Date 1549561596 28800 # Node ID 93620a4ba88d3e7b7a33afcf92f193be9ac2c857 # Parent 3751595ec45edfbd29c6852a3172593c53008750 subrepo: avoid calculating subrepo prefix twice for cat() (API) Differential Revision: https://phab.mercurial-scm.org/D5881 diff -r 3751595ec45e -r 93620a4ba88d mercurial/cmdutil.py --- a/mercurial/cmdutil.py Thu Feb 07 16:43:42 2019 +0300 +++ b/mercurial/cmdutil.py Thu Feb 07 09:46:36 2019 -0800 @@ -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