##// END OF EJS Templates
amend: allow amend of non-head when obsolete is enabled...
Pierre-Yves David -
r18163:c5bd753c default
parent child Browse files
Show More
@@ -1296,7 +1296,7 b' def commit(ui, repo, *pats, **opts):'
1296 raise util.Abort(_('cannot amend merge changesets'))
1296 raise util.Abort(_('cannot amend merge changesets'))
1297 if len(repo[None].parents()) > 1:
1297 if len(repo[None].parents()) > 1:
1298 raise util.Abort(_('cannot amend while merging'))
1298 raise util.Abort(_('cannot amend while merging'))
1299 if old.children():
1299 if (not obsolete._enabled) and old.children():
1300 raise util.Abort(_('cannot amend changeset with children'))
1300 raise util.Abort(_('cannot amend changeset with children'))
1301
1301
1302 e = cmdutil.commiteditor
1302 e = cmdutil.commiteditor
@@ -458,3 +458,23 b' Test that amend does not make it easy to'
458 $ hg commit --amend
458 $ hg commit --amend
459 $ hg id
459 $ hg id
460 b99e5df575f7 (a) tip
460 b99e5df575f7 (a) tip
461
462 Test ui.prevent-unstable
463 ---------------------------------------------------------------------
464
465 $ hg up '.^'
466 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
467 $ echo 'b' >> a
468 $ hg log --style compact -r 'children(.)'
469 18[tip]:11 b99e5df575f7 1970-01-01 00:00 +0000 test
470 babar
471
472 $ hg commit --amend
473 $ hg log -r 'unstable()'
474 changeset: 18:b99e5df575f7
475 branch: a
476 parent: 11:3334b7925910
477 user: test
478 date: Thu Jan 01 00:00:00 1970 +0000
479 summary: babar
480
General Comments 0
You need to be logged in to leave comments. Login now