Mercurial > evolve
diff tests/test-evolve-order.t @ 1370:0799c5831a3d
evolve: move test for evolve --rev ordering in a separate file
evolve --rev reordering is a complicated enough topic to justify a separate
test.
author | Laurent Charignon <lcharignon@fb.com> |
---|---|
date | Tue, 16 Jun 2015 14:49:28 -0700 |
parents | 4ed67cce8c23 |
children | b3afdc0815d0 |
line wrap: on
line diff
--- a/tests/test-evolve-order.t Tue Jun 16 14:30:43 2015 -0700 +++ b/tests/test-evolve-order.t Tue Jun 16 14:49:28 2015 -0700 @@ -27,15 +27,11 @@ $ mkstack() { > # Creates a stack of commit based on $1 with messages from $2, $3 .. - > hg update $1 -C + > hg update "$1" -C > shift > mkcommits $* > } - $ shaof() { - > hg log -T {node} -r "first(desc($1))" - > } - $ mkcommits() { > for i in $@; do mkcommit $i ; done > } @@ -74,7 +70,7 @@ accross three stacks in growing rev numbers. $ hg up "desc(_c)" 0 files updated, 0 files merged, 0 files removed, 0 files unresolved - $ mkcommit d + $ mkcommit _d $ hg up "desc(_a)" 0 files updated, 0 files merged, 3 files removed, 0 files unresolved $ hg amend -m "aprime" @@ -97,7 +93,7 @@ | | | x 9:81a687b96d4d@default(draft) aprime |/ - | o 8:2d86cc7ec3a9@default(draft) add d + | o 8:464731bc0ed0@default(draft) add _d | | | o 7:52b8f9b04f83@default(draft) add _c | | @@ -112,11 +108,11 @@ atop:[12] asecond move:[7] add _c atop:[13] bprime - move:[8] add d + move:[8] add _d atop:[14] add _c - working directory is now at fd447ba1b20b + working directory is now at 225d2cc5d3fc $ hg log -G - @ 15:fd447ba1b20b@default(draft) add d + @ 15:225d2cc5d3fc@default(draft) add _d | o 14:0fc229278e4d@default(draft) add _c | @@ -127,3 +123,115 @@ o 0:f92638be10c7@default(public) add p +Evolve --rev more complex case: two sets of stacks one with prune an no successor, the other one +partially solvable + +First set of stack: + $ mkstack "desc(_d)" c1_ c2_ c3_ c4_ >/dev/null + $ mkstack "desc(_d)" c1prime c2prime >/dev/null + $ mkstack "desc(_d)" c1second >/dev/null + $ hg prune "desc(c1_)" -s "desc(c1prime)" + 1 changesets pruned + 3 new unstable changesets + $ hg prune "desc(c2_)" -s "desc(c2prime)" + 1 changesets pruned + $ hg prune "desc(c1prime)" -s "desc(c1second)" + 1 changesets pruned + 1 new unstable changesets + $ hg log -G -r "desc(_d)::" + @ 22:a329855d0bc1@default(draft) add c1second + | + | o 21:072276ece1bf@default(draft) add c2prime + | | + | x 20:f137acd06692@default(draft) add c1prime + |/ + | o 19:0a1d9b2ce733@default(draft) add c4_ + | | + | o 18:e2874f41c56c@default(draft) add c3_ + | | + | x 17:3247c33339fa@default(draft) add c2_ + | | + | x 16:df322257c182@default(draft) add c1_ + |/ + o 15:225d2cc5d3fc@default(draft) add _d + | + +Second set of stack with no successor for b2_: + $ mkstack "desc(_d)" b1_ b2_ b3_ b4_ >/dev/null + $ mkstack "desc(_d)" b1prime b3prime >/dev/null + $ hg prune "desc(b1_)" -s "desc(b1prime)" + 1 changesets pruned + 3 new unstable changesets + $ hg prune "desc(b3_)" -s "desc(b3prime)" + 1 changesets pruned + $ hg prune "desc(b2_)" + 1 changesets pruned + + $ hg log -G -r "desc(_d)::" + @ 28:ba4c348b6d5e@default(draft) add b3prime + | + o 27:8fe985f5d0aa@default(draft) add b1prime + | + | o 26:1d9ba2e75c93@default(draft) add b4_ + | | + | x 25:aec6a9657b6c@default(draft) add b3_ + | | + | x 24:a69b58575918@default(draft) add b2_ + | | + | x 23:3564eb18e448@default(draft) add b1_ + |/ + | o 22:a329855d0bc1@default(draft) add c1second + |/ + | o 21:072276ece1bf@default(draft) add c2prime + | | + | x 20:f137acd06692@default(draft) add c1prime + |/ + | o 19:0a1d9b2ce733@default(draft) add c4_ + | | + | o 18:e2874f41c56c@default(draft) add c3_ + | | + | x 17:3247c33339fa@default(draft) add c2_ + | | + | x 16:df322257c182@default(draft) add c1_ + |/ + o 15:225d2cc5d3fc@default(draft) add _d + | + +Solve the full second stack and only part of the first one + $ echo "(desc(_d)::) - desc(c3_)" + (desc(_d)::) - desc(c3_) + $ hg evolve --rev "(desc(_d)::) - desc(c3_)" + cannot solve instability of 0a1d9b2ce733, skipping + move:[21] add c2prime + atop:[22] add c1second + move:[26] add b4_ + atop:[28] add b3prime + working directory is now at 4897c8ed7645 + +Cleanup + $ hg evolve --rev "(desc(_d)::)" + move:[18] add c3_ + atop:[29] add c2prime + move:[19] add c4_ + atop:[31] add c3_ + working directory is now at 4ee8feb52325 + $ hg log -G -r "desc(_d)::" + @ 32:4ee8feb52325@default(draft) add c4_ + | + o 31:08a530ce67e1@default(draft) add c3_ + | + | o 30:4897c8ed7645@default(draft) add b4_ + | | + o | 29:3abc7618dd5f@default(draft) add c2prime + | | + | o 28:ba4c348b6d5e@default(draft) add b3prime + | | + | o 27:8fe985f5d0aa@default(draft) add b1prime + | | + o | 22:a329855d0bc1@default(draft) add c1second + |/ + o 15:225d2cc5d3fc@default(draft) add _d + | + + +