Show More
@@ -425,13 +425,14 b' def archive(ui, repo, dest, **opts):' | |||||
425 |
|
425 | |||
426 | @command('backout', |
|
426 | @command('backout', | |
427 | [('', 'merge', None, _('merge with old dirstate parent after backout')), |
|
427 | [('', 'merge', None, _('merge with old dirstate parent after backout')), | |
|
428 | ('', 'commit', None, _('commit if no conflicts were encountered')), | |||
428 | ('', 'parent', '', |
|
429 | ('', 'parent', '', | |
429 | _('parent to choose when backing out merge (DEPRECATED)'), _('REV')), |
|
430 | _('parent to choose when backing out merge (DEPRECATED)'), _('REV')), | |
430 | ('r', 'rev', '', _('revision to backout'), _('REV')), |
|
431 | ('r', 'rev', '', _('revision to backout'), _('REV')), | |
431 | ('e', 'edit', False, _('invoke editor on commit messages')), |
|
432 | ('e', 'edit', False, _('invoke editor on commit messages')), | |
432 | ] + mergetoolopts + walkopts + commitopts + commitopts2, |
|
433 | ] + mergetoolopts + walkopts + commitopts + commitopts2, | |
433 | _('[OPTION]... [-r] REV')) |
|
434 | _('[OPTION]... [-r] REV')) | |
434 | def backout(ui, repo, node=None, rev=None, **opts): |
|
435 | def backout(ui, repo, node=None, rev=None, commit=False, **opts): | |
435 | '''reverse effect of earlier changeset |
|
436 | '''reverse effect of earlier changeset | |
436 |
|
437 | |||
437 | Prepare a new changeset with the effect of REV undone in the |
|
438 | Prepare a new changeset with the effect of REV undone in the | |
@@ -519,11 +520,12 b' def backout(ui, repo, node=None, rev=Non' | |||||
519 | if stats[3]: |
|
520 | if stats[3]: | |
520 | repo.ui.status(_("use 'hg resolve' to retry unresolved " |
|
521 | repo.ui.status(_("use 'hg resolve' to retry unresolved " | |
521 | "file merges\n")) |
|
522 | "file merges\n")) | |
522 |
|
|
523 | return 1 | |
|
524 | elif not commit: | |||
523 | msg = _("changeset %s backed out, " |
|
525 | msg = _("changeset %s backed out, " | |
524 | "don't forget to commit.\n") |
|
526 | "don't forget to commit.\n") | |
525 | ui.status(msg % short(node)) |
|
527 | ui.status(msg % short(node)) | |
526 |
return |
|
528 | return 0 | |
527 | finally: |
|
529 | finally: | |
528 | ui.setconfig('ui', 'forcemerge', '', '') |
|
530 | ui.setconfig('ui', 'forcemerge', '', '') | |
529 | else: |
|
531 | else: |
@@ -43,6 +43,47 b' specified explicitly)' | |||||
43 | commit: (clean) |
|
43 | commit: (clean) | |
44 | update: (current) |
|
44 | update: (current) | |
45 |
|
45 | |||
|
46 | commit option | |||
|
47 | ||||
|
48 | $ cd .. | |||
|
49 | $ hg init commit | |||
|
50 | $ cd commit | |||
|
51 | ||||
|
52 | $ echo tomatoes > a | |||
|
53 | $ hg add a | |||
|
54 | $ hg commit -d '0 0' -m tomatoes | |||
|
55 | ||||
|
56 | $ echo chair > b | |||
|
57 | $ hg add b | |||
|
58 | $ hg commit -d '1 0' -m chair | |||
|
59 | ||||
|
60 | $ echo grapes >> a | |||
|
61 | $ hg commit -d '2 0' -m grapes | |||
|
62 | ||||
|
63 | $ hg backout --commit -d '4 0' 1 --tool=:fail | |||
|
64 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |||
|
65 | changeset 3:1c2161e97c0a backs out changeset 1:22cb4f70d813 | |||
|
66 | $ hg summary | |||
|
67 | parent: 3:1c2161e97c0a tip | |||
|
68 | Backed out changeset 22cb4f70d813 | |||
|
69 | branch: default | |||
|
70 | commit: (clean) | |||
|
71 | update: (current) | |||
|
72 | ||||
|
73 | $ echo ypples > a | |||
|
74 | $ hg commit -d '5 0' -m ypples | |||
|
75 | ||||
|
76 | $ hg backout --commit -d '6 0' 2 --tool=:fail | |||
|
77 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |||
|
78 | use 'hg resolve' to retry unresolved file merges | |||
|
79 | [1] | |||
|
80 | $ hg summary | |||
|
81 | parent: 4:ed99997b793d tip | |||
|
82 | ypples | |||
|
83 | branch: default | |||
|
84 | commit: 1 unresolved (clean) | |||
|
85 | update: (current) | |||
|
86 | ||||
46 | file that was removed is recreated |
|
87 | file that was removed is recreated | |
47 | (this also tests that editor is not invoked if the commit message is |
|
88 | (this also tests that editor is not invoked if the commit message is | |
48 | specified explicitly) |
|
89 | specified explicitly) |
@@ -217,7 +217,7 b' Show all commands + options' | |||||
217 | update: clean, check, date, rev, tool |
|
217 | update: clean, check, date, rev, tool | |
218 | addremove: similarity, subrepos, include, exclude, dry-run |
|
218 | addremove: similarity, subrepos, include, exclude, dry-run | |
219 | archive: no-decode, prefix, rev, type, subrepos, include, exclude |
|
219 | archive: no-decode, prefix, rev, type, subrepos, include, exclude | |
220 | backout: merge, parent, rev, edit, tool, include, exclude, message, logfile, date, user |
|
220 | backout: merge, commit, parent, rev, edit, tool, include, exclude, message, logfile, date, user | |
221 | bisect: reset, good, bad, skip, extend, command, noupdate |
|
221 | bisect: reset, good, bad, skip, extend, command, noupdate | |
222 | bookmarks: force, rev, delete, rename, inactive, template |
|
222 | bookmarks: force, rev, delete, rename, inactive, template | |
223 | branch: force, clean |
|
223 | branch: force, clean |
General Comments 0
You need to be logged in to leave comments.
Login now