mercurial/cmdutil.py
changeset 26229 d1530c6e8613
parent 26222 3095b1027661
child 26324 4a8e21578e14
equal deleted inserted replaced
26228:0fd20a71abdb 26229:d1530c6e8613
   990     finally:
   990     finally:
   991         lockmod.release(dsguard)
   991         lockmod.release(dsguard)
   992         os.unlink(tmpname)
   992         os.unlink(tmpname)
   993 
   993 
   994 def export(repo, revs, template='hg-%h.patch', fp=None, switch_parent=False,
   994 def export(repo, revs, template='hg-%h.patch', fp=None, switch_parent=False,
   995            opts=None):
   995            opts=None, match=None):
   996     '''export changesets as hg patches.'''
   996     '''export changesets as hg patches.'''
   997 
   997 
   998     total = len(revs)
   998     total = len(revs)
   999     revwidth = max([len(str(rev)) for rev in revs])
   999     revwidth = max([len(str(rev)) for rev in revs])
  1000     filemode = {}
  1000     filemode = {}
  1041         if len(parents) > 1:
  1041         if len(parents) > 1:
  1042             write("# Parent  %s\n" % hex(parents[1]))
  1042             write("# Parent  %s\n" % hex(parents[1]))
  1043         write(ctx.description().rstrip())
  1043         write(ctx.description().rstrip())
  1044         write("\n\n")
  1044         write("\n\n")
  1045 
  1045 
  1046         for chunk, label in patch.diffui(repo, prev, node, opts=opts):
  1046         for chunk, label in patch.diffui(repo, prev, node, match, opts=opts):
  1047             write(chunk, label=label)
  1047             write(chunk, label=label)
  1048 
  1048 
  1049         if shouldclose:
  1049         if shouldclose:
  1050             fp.close()
  1050             fp.close()
  1051 
  1051