##// END OF EJS Templates
cmdutil: rename template param to export to fntemplate...
Augie Fackler -
r32431:9fd9f91b default
parent child Browse files
Show More
@@ -240,7 +240,7 b' def dodiff(ui, repo, cmdline, pats, opts'
240 else:
240 else:
241 template = 'hg-%h.patch'
241 template = 'hg-%h.patch'
242 cmdutil.export(repo, [repo[node1a].rev(), repo[node2].rev()],
242 cmdutil.export(repo, [repo[node1a].rev(), repo[node2].rev()],
243 template=repo.vfs.reljoin(tmproot, template),
243 fntemplate=repo.vfs.reljoin(tmproot, template),
244 match=matcher)
244 match=matcher)
245 label1a = cmdutil.makefilename(repo, template, node1a)
245 label1a = cmdutil.makefilename(repo, template, node1a)
246 label2 = cmdutil.makefilename(repo, template, node2)
246 label2 = cmdutil.makefilename(repo, template, node2)
@@ -1141,14 +1141,14 b' extraexport = []'
1141 # it is given two arguments (sequencenumber, changectx)
1141 # it is given two arguments (sequencenumber, changectx)
1142 extraexportmap = {}
1142 extraexportmap = {}
1143
1143
1144 def export(repo, revs, template='hg-%h.patch', fp=None, switch_parent=False,
1144 def export(repo, revs, fntemplate='hg-%h.patch', fp=None, switch_parent=False,
1145 opts=None, match=None):
1145 opts=None, match=None):
1146 '''export changesets as hg patches
1146 '''export changesets as hg patches
1147
1147
1148 Args:
1148 Args:
1149 repo: The repository from which we're exporting revisions.
1149 repo: The repository from which we're exporting revisions.
1150 revs: A list of revisions to export as revision numbers.
1150 revs: A list of revisions to export as revision numbers.
1151 template: An optional string to use for generating patch file names.
1151 fntemplate: An optional string to use for generating patch file names.
1152 fp: An optional file-like object to which patches should be written.
1152 fp: An optional file-like object to which patches should be written.
1153 switch_parent: If True, show diffs against second parent when not nullid.
1153 switch_parent: If True, show diffs against second parent when not nullid.
1154 Default is false, which always shows diff against p1.
1154 Default is false, which always shows diff against p1.
@@ -1163,7 +1163,7 b" def export(repo, revs, template='hg-%h.p"
1163 destinations:
1163 destinations:
1164 fp is specified: All revs are written to the specified
1164 fp is specified: All revs are written to the specified
1165 file-like object.
1165 file-like object.
1166 template specified: Each rev is written to a unique file named using
1166 fntemplate specified: Each rev is written to a unique file named using
1167 the given template.
1167 the given template.
1168 Neither fp nor template specified: All revs written to repo.ui.write()
1168 Neither fp nor template specified: All revs written to repo.ui.write()
1169 '''
1169 '''
@@ -1186,10 +1186,10 b" def export(repo, revs, template='hg-%h.p"
1186 prev = nullid
1186 prev = nullid
1187
1187
1188 shouldclose = False
1188 shouldclose = False
1189 if not fp and len(template) > 0:
1189 if not fp and len(fntemplate) > 0:
1190 desc_lines = ctx.description().rstrip().split('\n')
1190 desc_lines = ctx.description().rstrip().split('\n')
1191 desc = desc_lines[0] #Commit always has a first line.
1191 desc = desc_lines[0] #Commit always has a first line.
1192 fp = makefileobj(repo, template, node, desc=desc, total=total,
1192 fp = makefileobj(repo, fntemplate, node, desc=desc, total=total,
1193 seqno=seqno, revwidth=revwidth, mode='wb',
1193 seqno=seqno, revwidth=revwidth, mode='wb',
1194 modemap=filemode)
1194 modemap=filemode)
1195 shouldclose = True
1195 shouldclose = True
@@ -2001,7 +2001,7 b' def export(ui, repo, *changesets, **opts'
2001 else:
2001 else:
2002 ui.note(_('exporting patch:\n'))
2002 ui.note(_('exporting patch:\n'))
2003 ui.pager('export')
2003 ui.pager('export')
2004 cmdutil.export(repo, revs, template=opts.get('output'),
2004 cmdutil.export(repo, revs, fntemplate=opts.get('output'),
2005 switch_parent=opts.get('switch_parent'),
2005 switch_parent=opts.get('switch_parent'),
2006 opts=patch.diffallopts(ui, opts))
2006 opts=patch.diffallopts(ui, opts))
2007
2007
General Comments 0
You need to be logged in to leave comments. Login now