Patchwork [4,of,4,evolve-ext] evolve: add another test for evolve --rev

login
register
mail settings
Submitter Laurent Charignon
Date June 2, 2015, 11:01 p.m.
Message ID <829bab269e1dd4a56a01.1433286111@android-3d6658a7ca72b28f.dhcp.thefacebook.com>
Download mbox | patch
Permalink /patch/9450/
State Changes Requested
Headers show

Comments

Laurent Charignon - June 2, 2015, 11:01 p.m.
# HG changeset patch
# User Laurent Charignon <lcharignon@fb.com>
# Date 1433283852 25200
#      Tue Jun 02 15:24:12 2015 -0700
# Node ID 829bab269e1dd4a56a01a3d78826e37fdba601fa
# Parent  bea068c30c027d5a55bf841c1caf0fffc4364082
evolve: add another test for evolve --rev

This patch adds a test for three cases not covered before:
- evolve --rev on a stack with obsolete commits without successors
- evolve --rev on two sets of stacks in parallel
- evolve --rev on a set of stack partially solvable (because all of the
        commits of the stack are not specified with --rev)
Pierre-Yves David - June 3, 2015, 8:06 p.m.
On 06/02/2015 04:01 PM, Laurent Charignon wrote:
> # HG changeset patch
> # User Laurent Charignon <lcharignon@fb.com>
> # Date 1433283852 25200
> #      Tue Jun 02 15:24:12 2015 -0700
> # Node ID 829bab269e1dd4a56a01a3d78826e37fdba601fa
> # Parent  bea068c30c027d5a55bf841c1caf0fffc4364082
> evolve: add another test for evolve --rev
>
> This patch adds a test for three cases not covered before:
> - evolve --rev on a stack with obsolete commits without successors
> - evolve --rev on two sets of stacks in parallel
> - evolve --rev on a set of stack partially solvable (because all of the
>          commits of the stack are not specified with --rev)

Point 6 of contributing change says:

- patch does just one thing (if you need a bullet list, split your patch)

And it is usally true, lets make this three patches when you resend 
(since patch 2 need attentions)

Patch

diff --git a/tests/test-evolve.t b/tests/test-evolve.t
--- a/tests/test-evolve.t
+++ b/tests/test-evolve.t
@@ -1153,3 +1153,96 @@ 
   working directory now at 4c0bc042ef3b
   3 changesets pruned
 
+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 25 c1_ c2_ c3_ c4_ >/dev/null
+  $ mkstack 25 c1prime c2prime >/dev/null
+  $ mkstack 25 c1second >/dev/null
+  $ hg prune `shaof c1_` -s `shaof c1prime`
+  1 changesets pruned
+  3 new unstable changesets
+  $ hg prune `shaof c2_` -s `shaof c2prime`
+  1 changesets pruned
+  $ hg prune `shaof c1prime` -s `shaof c1second`
+  1 changesets pruned
+  1 new unstable changesets
+
+Second set of stack with no successor for b2_:
+  $ mkstack 25 b1_ b2_ b3_ b4_ >/dev/null
+  $ mkstack 25 b1prime b3prime >/dev/null
+  $ hg prune `shaof b1_` -s `shaof b1prime`
+  1 changesets pruned
+  3 new unstable changesets
+  $ hg prune `shaof b3_` -s `shaof b3prime`
+  1 changesets pruned
+  $ hg prune `shaof b2_`
+  1 changesets pruned
+
+  $ glog -r "25::"
+  @  48:2b5cbe59aeca@default(draft) add b3prime
+  |
+  o  47:aa4f5bf8925e@default(draft) add b1prime
+  |
+  | o  46:26b828ec5bcf@default(draft) add b4_
+  | |
+  | x  45:4f07e8c054ba@default(draft) add b3_
+  | |
+  | x  44:3973f60bfa8c@default(draft) add b2_
+  | |
+  | x  43:cddd50881a87@default(draft) add b1_
+  |/
+  | o  42:4a34f6744d4b@default(draft) add c1second
+  |/
+  | o  41:1a00113a0d9a@default(draft) add c2prime
+  | |
+  | x  40:c19e337376fa@default(draft) add c1prime
+  |/
+  | o  39:68e72c885d18@default(draft) add c4_
+  | |
+  | o  38:28172de7eb73@default(draft) add c3_
+  | |
+  | x  37:e2c8f75d4ecc@default(draft) add c2_
+  | |
+  | x  36:4ce6da951588@default(draft) add c1_
+  |/
+  o  25:4c0bc042ef3b@default(draft) add j1
+  |
+
+Solve the full second stack and only part of the first one
+  $ echo "(25::) - $(shaof c3_)"
+  (25::) - 28172de7eb73578cf665e868a265caf2a2655c66
+  $ hg evolve --rev "(25::) - $(shaof c3_)"
+  Cannot solve instability of 68e72c885d18, skipping
+  move:[41] add c2prime
+  atop:[42] add c1second
+  move:[46] add b4_
+  atop:[48] add b3prime
+  working directory is now at e543e9e71376
+  $ hg evolve --rev "(25::) - $(shaof c3_)"
+  Cannot solve instability of 68e72c885d18, skipping
+  $ hg evolve --rev "(25::)"
+  move:[38] add c3_
+  atop:[49] add c2prime
+  move:[39] add c4_
+  atop:[51] add c3_
+  working directory is now at 456e647fbe11
+  $ glog -r "25::"
+  @  52:456e647fbe11@default(draft) add c4_
+  |
+  o  51:07aaa06da467@default(draft) add c3_
+  |
+  | o  50:e543e9e71376@default(draft) add b4_
+  | |
+  o |  49:9379d7237601@default(draft) add c2prime
+  | |
+  | o  48:2b5cbe59aeca@default(draft) add b3prime
+  | |
+  | o  47:aa4f5bf8925e@default(draft) add b1prime
+  | |
+  o |  42:4a34f6744d4b@default(draft) add c1second
+  |/
+  o  25:4c0bc042ef3b@default(draft) add j1
+  |
+