Mercurial > public > mercurial-scm > hg
diff mercurial/commands.py @ 10818:d14d45fae927
diff: make use of output labeling
author | Brodie Rao <brodie@bitheap.org> |
---|---|
date | Fri, 02 Apr 2010 15:22:06 -0500 |
parents | 2096496b40ec |
children | 824310023e4a |
line wrap: on
line diff
--- a/mercurial/commands.py Fri Apr 02 15:22:05 2010 -0500 +++ b/mercurial/commands.py Fri Apr 02 15:22:06 2010 -0500 @@ -1174,14 +1174,16 @@ diffopts = patch.diffopts(ui, opts) m = cmdutil.match(repo, pats, opts) - it = patch.diff(repo, node1, node2, match=m, opts=diffopts) if stat: + it = patch.diff(repo, node1, node2, match=m, opts=diffopts) width = ui.interactive() and util.termwidth() or 80 - ui.write(patch.diffstat(util.iterlines(it), width=width, - git=diffopts.git)) + for chunk, label in patch.diffstatui(util.iterlines(it), width=width, + git=diffopts.git): + ui.write(chunk, label=label) else: - for chunk in it: - ui.write(chunk) + it = patch.diffui(repo, node1, node2, match=m, opts=diffopts) + for chunk, label in it: + ui.write(chunk, label=label) def export(ui, repo, *changesets, **opts): """dump the header and diffs for one or more changesets