cmdutil: rename template param to export to fntemplate
authorAugie Fackler <augie@google.com>
Sat, 20 May 2017 20:15:05 -0400
changeset 32431 9fd9f91b0c43
parent 32430 1f4be037f558
child 32432 75544176bc28
cmdutil: rename template param to export to fntemplate It's actually a template for the filename, not a formatter template.
hgext/extdiff.py
mercurial/cmdutil.py
mercurial/commands.py
--- a/hgext/extdiff.py	Sat May 20 17:58:04 2017 -0400
+++ b/hgext/extdiff.py	Sat May 20 20:15:05 2017 -0400
@@ -240,7 +240,7 @@
         else:
             template = 'hg-%h.patch'
             cmdutil.export(repo, [repo[node1a].rev(), repo[node2].rev()],
-                           template=repo.vfs.reljoin(tmproot, template),
+                           fntemplate=repo.vfs.reljoin(tmproot, template),
                            match=matcher)
             label1a = cmdutil.makefilename(repo, template, node1a)
             label2 = cmdutil.makefilename(repo, template, node2)
--- 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
--- a/mercurial/commands.py	Sat May 20 17:58:04 2017 -0400
+++ b/mercurial/commands.py	Sat May 20 20:15:05 2017 -0400
@@ -2001,7 +2001,7 @@
     else:
         ui.note(_('exporting patch:\n'))
     ui.pager('export')
-    cmdutil.export(repo, revs, template=opts.get('output'),
+    cmdutil.export(repo, revs, fntemplate=opts.get('output'),
                  switch_parent=opts.get('switch_parent'),
                  opts=patch.diffallopts(ui, opts))