tests/test-rebase-interruptions.t
changeset 15917 e66084ef8449
parent 15742 65df60a3f96b
child 17026 f8af57c00a29
--- a/tests/test-rebase-interruptions.t	Wed Jan 18 11:33:14 2012 +0100
+++ b/tests/test-rebase-interruptions.t	Tue Jan 17 09:12:14 2012 +0100
@@ -8,6 +8,7 @@
   > 
   > [alias]
   > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
+  > tglogp = log -G --template "{rev}:{phase} '{desc}' {branches}\n"
   > EOF
 
 
@@ -71,20 +72,24 @@
   $ hg add Extra
   $ hg ci -m 'Extra'
 
-  $ hg tglog
-  @  6: 'Extra'
+Force this commit onto secret phase
+
+  $ hg phase --force --secret 6
+
+  $ hg tglogp
+  @  6:secret 'Extra'
   |
-  | o  5: 'B'
-  | |
-  | o  4: 'E'
+  | o  5:draft 'B'
   | |
-  | o  3: 'D'
+  | o  4:draft 'E'
   | |
-  o |  2: 'C'
+  | o  3:draft 'D'
   | |
-  o |  1: 'B'
+  o |  2:draft 'C'
+  | |
+  o |  1:draft 'B'
   |/
-  o  0: 'A'
+  o  0:draft 'A'
   
 Resume the rebasing:
 
@@ -104,22 +109,22 @@
   $ hg rebase --continue
   warning: new changesets detected on source branch, not stripping
 
-  $ hg tglog
-  @  7: 'C'
+  $ hg tglogp
+  @  7:draft 'C'
   |
-  | o  6: 'Extra'
+  | o  6:secret 'Extra'
   | |
-  o |  5: 'B'
+  o |  5:draft 'B'
   | |
-  o |  4: 'E'
+  o |  4:draft 'E'
   | |
-  o |  3: 'D'
+  o |  3:draft 'D'
   | |
-  | o  2: 'C'
+  | o  2:draft 'C'
   | |
-  | o  1: 'B'
+  | o  1:draft 'B'
   |/
-  o  0: 'A'
+  o  0:draft 'A'
   
   $ cd ..
 
@@ -195,3 +200,68 @@
   
   $ cd ..
 
+Changes during an interruption - abort (again):
+
+  $ hg clone -q -u . a a3
+  $ cd a3
+
+  $ hg tglogp
+  @  4:draft 'E'
+  |
+  o  3:draft 'D'
+  |
+  | o  2:draft 'C'
+  | |
+  | o  1:draft 'B'
+  |/
+  o  0:draft 'A'
+  
+Rebasing B onto E:
+
+  $ hg rebase -s 1 -d 4
+  merging A
+  warning: conflicts during merge.
+  merging A incomplete! (edit conflicts, then use 'hg resolve --mark')
+  abort: unresolved conflicts (see hg resolve, then hg rebase --continue)
+  [255]
+
+Change phase on B and B'
+
+  $ hg up -q -C 5
+  $ hg phase --public 1
+  $ hg phase --public 5
+  $ hg phase --secret -f 2
+
+  $ hg tglogp
+  @  5:public 'B'
+  |
+  o  4:public 'E'
+  |
+  o  3:public 'D'
+  |
+  | o  2:secret 'C'
+  | |
+  | o  1:public 'B'
+  |/
+  o  0:public 'A'
+  
+Abort the rebasing:
+
+  $ hg rebase --abort
+  warning: immutable rebased changeset detected, can't abort
+  [255]
+
+  $ hg tglogp
+  @  5:public 'B'
+  |
+  o  4:public 'E'
+  |
+  o  3:public 'D'
+  |
+  | o  2:secret 'C'
+  | |
+  | o  1:public 'B'
+  |/
+  o  0:public 'A'
+  
+  $ cd ..