tests/test-commit-amend.t
branchstable
changeset 19305 b500a663a2c7
parent 18912 4e1ae55e63ef
child 19980 0151b61fed97
--- a/tests/test-commit-amend.t	Thu Jun 06 14:05:03 2013 -0400
+++ b/tests/test-commit-amend.t	Thu May 02 19:36:47 2013 +0300
@@ -743,3 +743,27 @@
   -aa
   -aa
   
+Issue 3445: amending with --close-branch a commit that created a new head should fail
+This shouldn't be possible:
+
+  $ hg up -q default
+  $ hg branch closewithamend
+  marked working directory as branch closewithamend
+  (branches are permanent and global, did you want a bookmark?)
+  $ hg ci -Am..
+  adding cc.orig
+  adding obs.py
+  adding obs.pyc
+  $ hg ci --amend --close-branch -m 'closing'
+  abort: can only close branch heads
+  [255]
+
+This silliness fails:
+
+  $ hg branch silliness
+  marked working directory as branch silliness
+  (branches are permanent and global, did you want a bookmark?)
+  $ echo b >> b
+  $ hg ci --close-branch -m'open and close'
+  abort: can only close branch heads
+  [255]