Mercurial > hg
comparison 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 |
comparison
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. |