Mercurial > public > mercurial-scm > hg-stable
diff mercurial/cmdutil.py @ 32573:f4cd4c49e302
cat: pass filename template as explicit argument
I'll move the handling of the '-' filename to commands.cat().
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 27 May 2017 18:50:05 +0900 |
parents | 447bbd970047 |
children | 7f4435078a8f |
line wrap: on
line diff
--- a/mercurial/cmdutil.py Thu May 25 21:28:08 2017 +0900 +++ b/mercurial/cmdutil.py Sat May 27 18:50:05 2017 +0900 @@ -2632,11 +2632,11 @@ return ret -def cat(ui, repo, ctx, matcher, prefix, **opts): +def cat(ui, repo, ctx, matcher, fntemplate, prefix, **opts): err = 1 def write(path): - fp = makefileobj(repo, opts.get('output'), ctx.node(), + fp = makefileobj(repo, fntemplate, ctx.node(), pathname=os.path.join(prefix, path)) data = ctx[path].data() if opts.get('decode'): @@ -2666,8 +2666,8 @@ try: submatch = matchmod.subdirmatcher(subpath, matcher) - if not sub.cat(submatch, os.path.join(prefix, sub._path), - **opts): + if not sub.cat(submatch, fntemplate, + os.path.join(prefix, sub._path), **opts): err = 0 except error.RepoLookupError: ui.status(_("skipping missing subrepository: %s\n")