Show More
@@ -1124,9 +1124,12 b' def diff(ui, repo, *pats, **opts):' | |||||
1124 |
|
1124 | |||
1125 | def doexport(ui, repo, changeset, seqno, total, revwidth, opts): |
|
1125 | def doexport(ui, repo, changeset, seqno, total, revwidth, opts): | |
1126 | node = repo.lookup(changeset) |
|
1126 | node = repo.lookup(changeset) | |
1127 |
p |
|
1127 | parents = [p for p in repo.changelog.parents(node) if p != nullid] | |
|
1128 | prev = (parents and parents[0]) or nullid | |||
1128 | change = repo.changelog.read(node) |
|
1129 | change = repo.changelog.read(node) | |
1129 |
|
1130 | |||
|
1131 | if opts['switch_parent']: | |||
|
1132 | parents.reverse() | |||
1130 | fp = make_file(repo, repo.changelog, opts['output'], |
|
1133 | fp = make_file(repo, repo.changelog, opts['output'], | |
1131 | node=node, total=total, seqno=seqno, |
|
1134 | node=node, total=total, seqno=seqno, | |
1132 | revwidth=revwidth) |
|
1135 | revwidth=revwidth) | |
@@ -1137,8 +1140,8 b' def doexport(ui, repo, changeset, seqno,' | |||||
1137 | fp.write("# User %s\n" % change[1]) |
|
1140 | fp.write("# User %s\n" % change[1]) | |
1138 | fp.write("# Node ID %s\n" % hex(node)) |
|
1141 | fp.write("# Node ID %s\n" % hex(node)) | |
1139 | fp.write("# Parent %s\n" % hex(prev)) |
|
1142 | fp.write("# Parent %s\n" % hex(prev)) | |
1140 | if other != nullid: |
|
1143 | if len(parents) > 1: | |
1141 |
fp.write("# Parent %s\n" % hex( |
|
1144 | fp.write("# Parent %s\n" % hex(parents[1])) | |
1142 | fp.write(change[4].rstrip()) |
|
1145 | fp.write(change[4].rstrip()) | |
1143 | fp.write("\n\n") |
|
1146 | fp.write("\n\n") | |
1144 |
|
1147 | |||
@@ -1169,6 +1172,9 b' def export(ui, repo, *changesets, **opts' | |||||
1169 | Without the -a option, export will avoid generating diffs of files |
|
1172 | Without the -a option, export will avoid generating diffs of files | |
1170 | it detects as binary. With -a, export will generate a diff anyway, |
|
1173 | it detects as binary. With -a, export will generate a diff anyway, | |
1171 | probably with undesirable results. |
|
1174 | probably with undesirable results. | |
|
1175 | ||||
|
1176 | With the --switch-parent option, the diff will be against the second | |||
|
1177 | parent. It can be useful to review a merge. | |||
1172 | """ |
|
1178 | """ | |
1173 | if not changesets: |
|
1179 | if not changesets: | |
1174 | raise util.Abort(_("export requires at least one changeset")) |
|
1180 | raise util.Abort(_("export requires at least one changeset")) | |
@@ -2263,7 +2269,8 b' table = {' | |||||
2263 | "^export": |
|
2269 | "^export": | |
2264 | (export, |
|
2270 | (export, | |
2265 | [('o', 'output', "", _('print output to file with formatted name')), |
|
2271 | [('o', 'output', "", _('print output to file with formatted name')), | |
2266 |
('a', 'text', None, _('treat all files as text')) |
|
2272 | ('a', 'text', None, _('treat all files as text')), | |
|
2273 | ('', 'switch-parent', None, _('diff against the second parent'))], | |||
2267 | "hg export [-a] [-o OUTFILE] REV..."), |
|
2274 | "hg export [-a] [-o OUTFILE] REV..."), | |
2268 | "forget": |
|
2275 | "forget": | |
2269 | (forget, |
|
2276 | (forget, |
General Comments 0
You need to be logged in to leave comments.
Login now