Mercurial > hg
changeset 14291:1a791993ce59
cmdutil: make_file to makefileobj
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Tue, 10 May 2011 16:08:47 -0500 |
parents | 86e70956da4f |
children | c97d8485b5fa |
files | mercurial/cmdutil.py mercurial/commands.py |
diffstat | 2 files changed, 6 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/cmdutil.py Tue May 10 16:08:46 2011 -0500 +++ b/mercurial/cmdutil.py Tue May 10 16:08:47 2011 -0500 @@ -234,8 +234,8 @@ raise util.Abort(_("invalid format spec '%%%s' in output filename") % inst.args[0]) -def make_file(repo, pat, node=None, - total=None, seqno=None, revwidth=None, mode='wb', pathname=None): +def makefileobj(repo, pat, node=None, total=None, + seqno=None, revwidth=None, mode='wb', pathname=None): writable = mode not in ('r', 'rb') @@ -541,8 +541,8 @@ shouldclose = False if not fp: - fp = make_file(repo, template, node, total=total, seqno=seqno, - revwidth=revwidth, mode='ab') + fp = makefileobj(repo, template, node, total=total, seqno=seqno, + revwidth=revwidth, mode='ab') if fp != template: shouldclose = True if fp != sys.stdout and hasattr(fp, 'name'):
--- a/mercurial/commands.py Tue May 10 16:08:46 2011 -0500 +++ b/mercurial/commands.py Tue May 10 16:08:47 2011 -0500 @@ -748,7 +748,8 @@ err = 1 m = cmdutil.match(repo, (file1,) + pats, opts) for abs in ctx.walk(m): - fp = cmdutil.make_file(repo, opts.get('output'), ctx.node(), pathname=abs) + fp = cmdutil.makefileobj(repo, opts.get('output'), ctx.node(), + pathname=abs) data = ctx[abs].data() if opts.get('decode'): data = repo.wwritedata(abs, data)