comparison tests/test-evolve-order.t @ 1369:4ed67cce8c23

evolve: properly evolve stacked unstable with --rev Before this patch, _singlesuccessor was not returning a revision number for the case where the parent of the argument was not obsolete. This resulted in bug when testing membership with the set of revisions. This patch fixes it and adds a test.
author Laurent Charignon <lcharignon@fb.com>
date Tue, 16 Jun 2015 14:30:43 -0700
parents
children 0799c5831a3d
comparison
equal deleted inserted replaced
1368:c02cdb97ebfa 1369:4ed67cce8c23
1 evolve --rev reordering
2 -----------------------
3
4 $ cat >> $HGRCPATH <<EOF
5 > [defaults]
6 > amend=-d "0 0"
7 > fold=-d "0 0"
8 > [web]
9 > push_ssl = false
10 > allow_push = *
11 > [phases]
12 > publish = False
13 > [diff]
14 > git = 1
15 > unified = 0
16 > [ui]
17 > logtemplate = {rev}:{node|short}@{branch}({phase}) {desc|firstline}\n
18 > [extensions]
19 > hgext.graphlog=
20 > EOF
21 $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext/evolve.py" >> $HGRCPATH
22 $ mkcommit() {
23 > echo "$1" > "$1"
24 > hg add "$1"
25 > hg ci -m "add $1"
26 > }
27
28 $ mkstack() {
29 > # Creates a stack of commit based on $1 with messages from $2, $3 ..
30 > hg update $1 -C
31 > shift
32 > mkcommits $*
33 > }
34
35 $ shaof() {
36 > hg log -T {node} -r "first(desc($1))"
37 > }
38
39 $ mkcommits() {
40 > for i in $@; do mkcommit $i ; done
41 > }
42
43 Initial setup
44 $ hg init testrevorder
45 $ cd testrevorder
46 $ mkcommits p _a _b _c
47 $ hg phase --public 0
48 $ hg up 'desc(_a)'
49 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
50 $ echo "aaa" > _a
51 $ hg amend
52 2 new unstable changesets
53 $ hg log -G
54 @ 5:12d519679175@default(draft) add _a
55 |
56 | o 3:4d156641b718@default(draft) add _c
57 | |
58 | o 2:4d7242ebb004@default(draft) add _b
59 | |
60 | x 1:2d73fcd7f07d@default(draft) add _a
61 |/
62 o 0:f92638be10c7@default(public) add p
63
64
65 evolve --rev reorders the rev to solve instability, trivial case 2 revs wrong order
66 $ hg evolve --rev 'desc(_c) + desc(_b)'
67 move:[2] add _b
68 atop:[5] add _a
69 move:[3] add _c
70 atop:[6] add _b
71 working directory is now at 52b8f9b04f83
72
73 evolve --rev reorders the rev to solve instability. Harder case, obsolescence
74 accross three stacks in growing rev numbers.
75 $ hg up "desc(_c)"
76 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
77 $ mkcommit d
78 $ hg up "desc(_a)"
79 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
80 $ hg amend -m "aprime"
81 3 new unstable changesets
82 $ hg evolve --rev "desc(_b)"
83 move:[6] add _b
84 atop:[9] aprime
85 working directory is now at 476c9c052aae
86 $ hg up "desc(_b) - obsolete()"
87 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
88 $ hg amend -m "bprime"
89 $ hg up "desc(aprime)"
90 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
91 $ hg amend -m "asecond"
92 1 new unstable changesets
93 $ hg log -G
94 @ 12:9a584314f3f3@default(draft) asecond
95 |
96 | o 11:a59c79776f7c@default(draft) bprime
97 | |
98 | x 9:81a687b96d4d@default(draft) aprime
99 |/
100 | o 8:2d86cc7ec3a9@default(draft) add d
101 | |
102 | o 7:52b8f9b04f83@default(draft) add _c
103 | |
104 | x 6:59476c3836ef@default(draft) add _b
105 | |
106 | x 5:12d519679175@default(draft) add _a
107 |/
108 o 0:f92638be10c7@default(public) add p
109
110 $ hg evolve --rev "unstable()"
111 move:[11] bprime
112 atop:[12] asecond
113 move:[7] add _c
114 atop:[13] bprime
115 move:[8] add d
116 atop:[14] add _c
117 working directory is now at fd447ba1b20b
118 $ hg log -G
119 @ 15:fd447ba1b20b@default(draft) add d
120 |
121 o 14:0fc229278e4d@default(draft) add _c
122 |
123 o 13:c3741b9eafae@default(draft) bprime
124 |
125 o 12:9a584314f3f3@default(draft) asecond
126 |
127 o 0:f92638be10c7@default(public) add p
128
129