1170 node1, node2 = cmdutil.revpair(repo, revs) |
1170 node1, node2 = cmdutil.revpair(repo, revs) |
1171 |
1171 |
1172 if reverse: |
1172 if reverse: |
1173 node1, node2 = node2, node1 |
1173 node1, node2 = node2, node1 |
1174 |
1174 |
1175 if stat: |
|
1176 opts['unified'] = '0' |
|
1177 diffopts = patch.diffopts(ui, opts) |
1175 diffopts = patch.diffopts(ui, opts) |
1178 |
|
1179 m = cmdutil.match(repo, pats, opts) |
1176 m = cmdutil.match(repo, pats, opts) |
1180 if stat: |
1177 cmdutil.diffordiffstat(ui, repo, diffopts, node1, node2, m, stat=stat) |
1181 it = patch.diff(repo, node1, node2, match=m, opts=diffopts) |
|
1182 width = 80 |
|
1183 if not ui.plain(): |
|
1184 width = util.termwidth() |
|
1185 for chunk, label in patch.diffstatui(util.iterlines(it), width=width, |
|
1186 git=diffopts.git): |
|
1187 ui.write(chunk, label=label) |
|
1188 else: |
|
1189 it = patch.diffui(repo, node1, node2, match=m, opts=diffopts) |
|
1190 for chunk, label in it: |
|
1191 ui.write(chunk, label=label) |
|
1192 |
1178 |
1193 def export(ui, repo, *changesets, **opts): |
1179 def export(ui, repo, *changesets, **opts): |
1194 """dump the header and diffs for one or more changesets |
1180 """dump the header and diffs for one or more changesets |
1195 |
1181 |
1196 Print the changeset header and diffs for one or more revisions. |
1182 Print the changeset header and diffs for one or more revisions. |