Submitter | Yuya Nishihara |
---|---|
Date | May 30, 2017, 4:07 p.m. |
Message ID | <d403731c94f481cb5349.1496160432@mimosa> |
Download | mbox | patch |
Permalink | /patch/21071/ |
State | Accepted |
Headers | show |
Comments
Patch
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -2636,8 +2636,12 @@ def cat(ui, repo, ctx, matcher, fntempla err = 1 def write(path): - fp = makefileobj(repo, fntemplate, ctx.node(), - pathname=os.path.join(prefix, path)) + if fntemplate: + filename = makefilename(repo, fntemplate, ctx.node(), + pathname=os.path.join(prefix, path)) + fp = open(filename, 'wb') + else: + fp = _unclosablefile(ui.fout) data = ctx[path].data() if opts.get('decode'): data = repo.wwritedata(path, data)