--- a/tests/test-evolve.t Sat Oct 25 22:25:42 2014 -0400
+++ b/tests/test-evolve.t Sat Nov 01 13:48:34 2014 +0000
@@ -770,3 +770,79 @@
7 - 5c9c8d9c2e4e another feature (child of ba0ec09b1bab) (public)
6 - ba0ec09b1bab a nifty feature (public)
0 - e55e0562ee93 base (public)
+
+ $ cd ..
+
+Test branch preservation:
+===========================
+
+ $ hg init evolving-branch
+ $ cd evolving-branch
+ $ touch a
+ $ hg add a
+ $ hg ci -m 'a0'
+ $ echo 1 > a
+ $ hg ci -m 'a1'
+ $ echo 2 > a
+ $ hg ci -m 'a2'
+ $ echo 3 > a
+ $ hg ci -m 'a3'
+
+ $ hg log -G --template '{rev} [{branch}] {desc|firstline}\n'
+ @ 3 [default] a3
+ |
+ o 2 [default] a2
+ |
+ o 1 [default] a1
+ |
+ o 0 [default] a0
+
+
+branch change propagated
+
+ $ hg up 'desc(a2)'
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg branch mybranch
+ marked working directory as branch mybranch
+ (branches are permanent and global, did you want a bookmark?)
+ $ hg amend
+ 1 new unstable changesets
+
+ $ hg evolve
+ move:[3] a3
+ atop:[5] a2
+ working directory is now at 7c5649f73d11
+
+ $ hg log -G --template '{rev} [{branch}] {desc|firstline}\n'
+ @ 6 [mybranch] a3
+ |
+ o 5 [mybranch] a2
+ |
+ o 1 [default] a1
+ |
+ o 0 [default] a0
+
+
+branch change preserved
+
+ $ hg up 'desc(a1)'
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ hg amend -m 'a1_'
+ 2 new unstable changesets
+ $ hg evolve
+ move:[5] a2
+ atop:[7] a1_
+ working directory is now at 5406c5cfee42
+ $ hg evolve
+ move:[6] a3
+ atop:[8] a2
+ working directory is now at c7661e655801
+ $ hg log -G --template '{rev} [{branch}] {desc|firstline}\n'
+ @ 9 [mybranch] a3
+ |
+ o 8 [mybranch] a2
+ |
+ o 7 [default] a1_
+ |
+ o 0 [default] a0
+