Mercurial > public > mercurial-scm > hg-stable
diff mercurial/cmdutil.py @ 32469:9fd9f91b0c43
cmdutil: rename template param to export to fntemplate
It's actually a template for the filename, not a formatter template.
author | Augie Fackler <augie@google.com> |
---|---|
date | Sat, 20 May 2017 20:15:05 -0400 |
parents | 1f4be037f558 |
children | 75544176bc28 |
line wrap: on
line diff
--- a/mercurial/cmdutil.py Sat May 20 17:58:04 2017 -0400 +++ b/mercurial/cmdutil.py Sat May 20 20:15:05 2017 -0400 @@ -1141,14 +1141,14 @@ # it is given two arguments (sequencenumber, changectx) extraexportmap = {} -def export(repo, revs, template='hg-%h.patch', fp=None, switch_parent=False, +def export(repo, revs, fntemplate='hg-%h.patch', fp=None, switch_parent=False, opts=None, match=None): '''export changesets as hg patches Args: repo: The repository from which we're exporting revisions. revs: A list of revisions to export as revision numbers. - template: An optional string to use for generating patch file names. + fntemplate: An optional string to use for generating patch file names. fp: An optional file-like object to which patches should be written. switch_parent: If True, show diffs against second parent when not nullid. Default is false, which always shows diff against p1. @@ -1163,7 +1163,7 @@ destinations: fp is specified: All revs are written to the specified file-like object. - template specified: Each rev is written to a unique file named using + fntemplate specified: Each rev is written to a unique file named using the given template. Neither fp nor template specified: All revs written to repo.ui.write() ''' @@ -1186,10 +1186,10 @@ prev = nullid shouldclose = False - if not fp and len(template) > 0: + if not fp and len(fntemplate) > 0: desc_lines = ctx.description().rstrip().split('\n') desc = desc_lines[0] #Commit always has a first line. - fp = makefileobj(repo, template, node, desc=desc, total=total, + fp = makefileobj(repo, fntemplate, node, desc=desc, total=total, seqno=seqno, revwidth=revwidth, mode='wb', modemap=filemode) shouldclose = True