1 |
|
2 Check we can find the topic extensions |
|
3 |
|
4 $ cat >> $HGRCPATH <<EOF |
|
5 > [defaults] |
|
6 > amend=-d "0 0" |
|
7 > fold=-d "0 0" |
|
8 > [phases] |
|
9 > publish = False |
|
10 > [ui] |
|
11 > logtemplate = {rev} - \{{get(namespaces, "topics")}} {node|short} {desc} ({phase})\n |
|
12 > [diff] |
|
13 > git = 1 |
|
14 > unified = 0 |
|
15 > [extensions] |
|
16 > rebase = |
|
17 > EOF |
|
18 $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH |
|
19 $ echo "topic=$(echo $(dirname $TESTDIR))/hgext3rd/topic/" >> $HGRCPATH |
|
20 |
|
21 $ mkcommit() { |
|
22 > echo "$1" > "$1" |
|
23 > hg add "$1" |
|
24 > hg ci -m "add $1" |
|
25 > } |
|
26 |
|
27 Create a simple setup |
|
28 |
|
29 $ hg init repoa |
|
30 $ cd repoa |
|
31 $ mkcommit aaa |
|
32 $ mkcommit bbb |
|
33 $ hg topic foo |
|
34 $ mkcommit ccc |
|
35 $ mkcommit ddd |
|
36 $ mkcommit eee |
|
37 $ mkcommit fff |
|
38 $ hg topic bar |
|
39 $ mkcommit ggg |
|
40 $ mkcommit hhh |
|
41 $ mkcommit iii |
|
42 $ mkcommit jjj |
|
43 |
|
44 $ hg log -G |
|
45 @ 9 - {bar} 1d964213b023 add jjj (draft) |
|
46 | |
|
47 o 8 - {bar} fcab990f3261 add iii (draft) |
|
48 | |
|
49 o 7 - {bar} b0c2554835ac add hhh (draft) |
|
50 | |
|
51 o 6 - {bar} c748293f1c1a add ggg (draft) |
|
52 | |
|
53 o 5 - {foo} 6a6b7365c751 add fff (draft) |
|
54 | |
|
55 o 4 - {foo} 3969ab847d9c add eee (draft) |
|
56 | |
|
57 o 3 - {foo} 4e3a154f38c7 add ddd (draft) |
|
58 | |
|
59 o 2 - {foo} cced9bac76e3 add ccc (draft) |
|
60 | |
|
61 o 1 - {} a4dbed0837ea add bbb (draft) |
|
62 | |
|
63 o 0 - {} 199cc73e9a0b add aaa (draft) |
|
64 |
|
65 |
|
66 Test that evolve --all evolve the current topic |
|
67 ----------------------------------------------- |
|
68 |
|
69 make a mess |
|
70 |
|
71 $ hg up foo |
|
72 switching to topic foo |
|
73 0 files updated, 0 files merged, 4 files removed, 0 files unresolved |
|
74 $ hg topic -l |
|
75 ### topic: foo (?) |
|
76 ### branch: default (?) |
|
77 t4@ add fff (current) |
|
78 t3: add eee |
|
79 t2: add ddd |
|
80 t1: add ccc |
|
81 ^ add bbb |
|
82 $ hg up 'desc(ddd)' |
|
83 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
84 $ echo ddd >> ddd |
|
85 $ hg amend |
|
86 6 new unstable changesets |
|
87 $ hg up 'desc(fff)' |
|
88 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
89 $ echo fff >> fff |
|
90 $ hg amend |
|
91 |
|
92 $ hg log -G |
|
93 @ 13 - {foo} e104f49bab28 add fff (draft) |
|
94 | |
|
95 | o 11 - {foo} d9cacd156ffc add ddd (draft) |
|
96 | | |
|
97 | | o 9 - {bar} 1d964213b023 add jjj (draft) |
|
98 | | | |
|
99 | | o 8 - {bar} fcab990f3261 add iii (draft) |
|
100 | | | |
|
101 | | o 7 - {bar} b0c2554835ac add hhh (draft) |
|
102 | | | |
|
103 | | o 6 - {bar} c748293f1c1a add ggg (draft) |
|
104 | | | |
|
105 +---x 5 - {foo} 6a6b7365c751 add fff (draft) |
|
106 | | |
|
107 o | 4 - {foo} 3969ab847d9c add eee (draft) |
|
108 | | |
|
109 x | 3 - {foo} 4e3a154f38c7 add ddd (draft) |
|
110 |/ |
|
111 o 2 - {foo} cced9bac76e3 add ccc (draft) |
|
112 | |
|
113 o 1 - {} a4dbed0837ea add bbb (draft) |
|
114 | |
|
115 o 0 - {} 199cc73e9a0b add aaa (draft) |
|
116 |
|
117 |
|
118 Run evolve --all |
|
119 |
|
120 $ hg evolve --all |
|
121 move:[4] add eee |
|
122 atop:[11] add ddd |
|
123 move:[13] add fff |
|
124 atop:[14] add eee |
|
125 working directory is now at 070c5573d8f9 |
|
126 $ hg log -G |
|
127 @ 15 - {foo} 070c5573d8f9 add fff (draft) |
|
128 | |
|
129 o 14 - {foo} 42b49017ff90 add eee (draft) |
|
130 | |
|
131 o 11 - {foo} d9cacd156ffc add ddd (draft) |
|
132 | |
|
133 | o 9 - {bar} 1d964213b023 add jjj (draft) |
|
134 | | |
|
135 | o 8 - {bar} fcab990f3261 add iii (draft) |
|
136 | | |
|
137 | o 7 - {bar} b0c2554835ac add hhh (draft) |
|
138 | | |
|
139 | o 6 - {bar} c748293f1c1a add ggg (draft) |
|
140 | | |
|
141 | x 5 - {foo} 6a6b7365c751 add fff (draft) |
|
142 | | |
|
143 | x 4 - {foo} 3969ab847d9c add eee (draft) |
|
144 | | |
|
145 | x 3 - {foo} 4e3a154f38c7 add ddd (draft) |
|
146 |/ |
|
147 o 2 - {foo} cced9bac76e3 add ccc (draft) |
|
148 | |
|
149 o 1 - {} a4dbed0837ea add bbb (draft) |
|
150 | |
|
151 o 0 - {} 199cc73e9a0b add aaa (draft) |
|
152 |
|
153 |
|
154 Test that evolve does not loose topic information |
|
155 ------------------------------------------------- |
|
156 |
|
157 $ hg evolve --rev 'topic(bar)' |
|
158 move:[6] add ggg |
|
159 atop:[15] add fff |
|
160 move:[7] add hhh |
|
161 atop:[16] add ggg |
|
162 move:[8] add iii |
|
163 atop:[17] add hhh |
|
164 move:[9] add jjj |
|
165 atop:[18] add iii |
|
166 working directory is now at 9bf430c106b7 |
|
167 $ hg log -G |
|
168 @ 19 - {bar} 9bf430c106b7 add jjj (draft) |
|
169 | |
|
170 o 18 - {bar} d2dc89c57700 add iii (draft) |
|
171 | |
|
172 o 17 - {bar} 20bc4d02aa62 add hhh (draft) |
|
173 | |
|
174 o 16 - {bar} 16d6f664b17c add ggg (draft) |
|
175 | |
|
176 o 15 - {foo} 070c5573d8f9 add fff (draft) |
|
177 | |
|
178 o 14 - {foo} 42b49017ff90 add eee (draft) |
|
179 | |
|
180 o 11 - {foo} d9cacd156ffc add ddd (draft) |
|
181 | |
|
182 o 2 - {foo} cced9bac76e3 add ccc (draft) |
|
183 | |
|
184 o 1 - {} a4dbed0837ea add bbb (draft) |
|
185 | |
|
186 o 0 - {} 199cc73e9a0b add aaa (draft) |
|
187 |
|
188 |
|
189 Tests next and prev behavior |
|
190 ============================ |
|
191 |
|
192 Basic move are restricted to the current topic |
|
193 |
|
194 $ hg up foo |
|
195 switching to topic foo |
|
196 0 files updated, 0 files merged, 4 files removed, 0 files unresolved |
|
197 $ hg prev |
|
198 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
199 [14] add eee |
|
200 $ hg next |
|
201 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
202 [15] add fff |
|
203 $ hg next |
|
204 no children on topic "foo" |
|
205 do you want --no-topic |
|
206 [1] |
|
207 $ hg next --no-topic |
|
208 switching to topic bar |
|
209 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
210 [16] add ggg |
|
211 $ hg prev |
|
212 no parent in topic "bar" |
|
213 (do you want --no-topic) |
|
214 $ hg prev --no-topic |
|
215 switching to topic foo |
|
216 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
217 [15] add fff |
|