mercurial/commands.py
changeset 10818 d14d45fae927
parent 10817 2096496b40ec
child 10830 824310023e4a
equal deleted inserted replaced
10817:2096496b40ec 10818:d14d45fae927
  1172     if stat:
  1172     if stat:
  1173         opts['unified'] = '0'
  1173         opts['unified'] = '0'
  1174     diffopts = patch.diffopts(ui, opts)
  1174     diffopts = patch.diffopts(ui, opts)
  1175 
  1175 
  1176     m = cmdutil.match(repo, pats, opts)
  1176     m = cmdutil.match(repo, pats, opts)
  1177     it = patch.diff(repo, node1, node2, match=m, opts=diffopts)
       
  1178     if stat:
  1177     if stat:
       
  1178         it = patch.diff(repo, node1, node2, match=m, opts=diffopts)
  1179         width = ui.interactive() and util.termwidth() or 80
  1179         width = ui.interactive() and util.termwidth() or 80
  1180         ui.write(patch.diffstat(util.iterlines(it), width=width,
  1180         for chunk, label in patch.diffstatui(util.iterlines(it), width=width,
  1181                                 git=diffopts.git))
  1181                                              git=diffopts.git):
       
  1182             ui.write(chunk, label=label)
  1182     else:
  1183     else:
  1183         for chunk in it:
  1184         it = patch.diffui(repo, node1, node2, match=m, opts=diffopts)
  1184             ui.write(chunk)
  1185         for chunk, label in it:
       
  1186             ui.write(chunk, label=label)
  1185 
  1187 
  1186 def export(ui, repo, *changesets, **opts):
  1188 def export(ui, repo, *changesets, **opts):
  1187     """dump the header and diffs for one or more changesets
  1189     """dump the header and diffs for one or more changesets
  1188 
  1190 
  1189     Print the changeset header and diffs for one or more revisions.
  1191     Print the changeset header and diffs for one or more revisions.