Mercurial > evolve
annotate tests/test-userguide.t @ 1562:b1158ce4ec50
test: adapt to fix to "known" wireprotocol command
Core fixed a bug in discovery (in b64b6fdc5c9b) and this is showing up in our
test output.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Fri, 11 Dec 2015 11:15:33 +0000 |
parents | c868a69c29c5 |
children | 27445da063b7 |
rev | line source |
---|---|
978 | 1 ensure that all the scenarios in the user guide work as documented |
2 | |
3 basic repo | |
4 $ hg init t | |
5 $ cd t | |
6 $ touch file1.c file2.c | |
7 $ hg -q commit -A -m init | |
8 | |
9 example 1: commit creates a changeset in draft phase | |
10 (this is nothing to do with evolve, but it's mentioned in the user guide) | |
11 $ echo 'feature Y' >> file1.c | |
12 $ hg commit -u alice -d '0 0' -m 'implement feature X' | |
13 $ hg phase -r . | |
14 1: draft | |
15 $ hg identify -in | |
16 6e725fd2be6f 1 | |
17 | |
18 example 2: unsafe amend with plain vanilla Mercurial: the original | |
19 commit is stripped | |
20 $ hg commit --amend -u alice -d '1 0' -m 'implement feature Y' | |
1195
af9fd422adbb
tests: update to new core output
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
1133
diff
changeset
|
21 saved backup bundle to $TESTTMP/t/.hg/strip-backup/6e725fd2be6f-42cc74d4-amend-backup.hg (glob) |
978 | 22 $ hg log -r 23fe4ac6d3f1 |
23 abort: unknown revision '23fe4ac6d3f1'! | |
24 [255] | |
25 $ hg identify -in | |
26 fe0ecd3bd2a4 1 | |
27 | |
28 enable evolve for safe history modification | |
29 $ cat >> $HGRCPATH <<EOF | |
30 > [alias] | |
31 > shortlog = log --template '{rev}:{node|short} {phase} {desc|firstline}\n' | |
32 > [extensions] | |
33 > rebase = | |
34 > EOF | |
35 $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext/evolve.py" >> $HGRCPATH | |
36 | |
37 example 3: safe amend with "hg commit --amend" (figure 2) | |
38 $ echo 'tweak feature Y' >> file1.c | |
39 $ hg commit --amend -u alice -d '2 0' -m 'implement feature Y' | |
40 $ hg shortlog -q -r fe0ecd3bd2a4 | |
1133
8b3b0549a4b6
test: adapt to new hidden-changeset message
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
1110
diff
changeset
|
41 abort: hidden revision 'fe0ecd3bd2a4'! |
8b3b0549a4b6
test: adapt to new hidden-changeset message
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
1110
diff
changeset
|
42 (use --hidden to access hidden revisions) |
978 | 43 [255] |
44 $ hg --hidden shortlog -G | |
45 @ 3:934359450037 draft implement feature Y | |
46 | | |
47 | x 2:6c5f78d5d467 draft temporary amend commit for fe0ecd3bd2a4 | |
48 | | | |
49 | x 1:fe0ecd3bd2a4 draft implement feature Y | |
50 |/ | |
51 o 0:08c4b6f4efc8 draft init | |
52 | |
53 example 3 redux: repeat safe amend, this time with "hg amend" | |
54 $ hg rollback -q | |
55 $ hg amend -u alice -d '2 0' -m 'implement feature Y' | |
56 $ hg --hidden shortlog -G | |
57 @ 3:934359450037 draft implement feature Y | |
58 | | |
59 | x 2:6c5f78d5d467 draft temporary amend commit for fe0ecd3bd2a4 | |
60 | | | |
61 | x 1:fe0ecd3bd2a4 draft implement feature Y | |
62 |/ | |
63 o 0:08c4b6f4efc8 draft init | |
64 | |
65 example 4: prune at head (figure 3) | |
66 $ echo 'debug hack' >> file1.c | |
67 $ hg commit -m 'debug hack' | |
68 $ hg prune . | |
69 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
70 working directory now at 934359450037 | |
1239
8a06b32061ce
evolve: apply prune update before creating obsolescence markers
Laurent Charignon <lcharignon@fb.com>
parents:
1195
diff
changeset
|
71 1 changesets pruned |
978 | 72 $ hg parents --template '{rev}:{node|short} {desc|firstline}\n' |
73 3:934359450037 implement feature Y | |
74 $ hg --hidden shortlog -G -r 3: | |
75 x 4:a3e0ef24aaf0 draft debug hack | |
76 | | |
77 @ 3:934359450037 draft implement feature Y | |
78 | | |
79 | |
80 example 5: uncommit files at head (figure 4) | |
81 $ echo 'relevant' >> file1.c | |
82 $ echo 'irrelevant' >> file2.c | |
83 $ hg commit -u dan -d '10 0' -m 'fix bug 234' | |
84 $ hg uncommit file2.c | |
85 $ hg status | |
86 M file2.c | |
87 $ hg --hidden shortlog -G -r 'descendants(3) - 4' | |
88 @ 6:c8defeecf7a4 draft fix bug 234 | |
89 | | |
90 | x 5:da4331967f5f draft fix bug 234 | |
91 |/ | |
92 o 3:934359450037 draft implement feature Y | |
93 | | |
94 $ hg parents --template '{rev}:{node|short} {desc|firstline}\n{files}\n' | |
95 6:c8defeecf7a4 fix bug 234 | |
96 file1.c | |
97 $ hg revert --no-backup file2.c | |
98 | |
99 example 6: fold multiple changesets together into one (figure 5) | |
100 $ echo step1 >> file1.c | |
101 $ hg commit -m 'step 1' | |
102 $ echo step2 >> file1.c | |
103 $ hg commit -m 'step 2' | |
104 $ echo step3 >> file2.c | |
105 $ hg commit -m 'step 3' | |
106 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' -r 7:: | |
107 7:05e61aab8294 step 1 | |
108 8:be6d5bc8e4cc step 2 | |
109 9:35f432d9f7c1 step 3 | |
110 $ hg fold -d '0 0' -m 'fix bug 64' -r 7:: | |
111 3 changesets folded | |
112 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
113 $ hg --hidden shortlog -G -r 6:: | |
114 @ 10:171c6a79a27b draft fix bug 64 | |
115 | | |
116 | x 9:35f432d9f7c1 draft step 3 | |
117 | | | |
118 | x 8:be6d5bc8e4cc draft step 2 | |
119 | | | |
120 | x 7:05e61aab8294 draft step 1 | |
121 |/ | |
122 o 6:c8defeecf7a4 draft fix bug 234 | |
123 | | |
124 $ hg --hidden log -q -r 'successors(7) | successors(8) | successors(9)' | |
125 10:171c6a79a27b | |
126 $ hg --hidden log -q -r 'precursors(10)' | |
127 7:05e61aab8294 | |
128 8:be6d5bc8e4cc | |
129 9:35f432d9f7c1 | |
130 $ hg diff -c 10 -U 0 | |
131 diff -r c8defeecf7a4 -r 171c6a79a27b file1.c | |
132 --- a/file1.c Thu Jan 01 00:00:10 1970 +0000 | |
133 +++ b/file1.c Thu Jan 01 00:00:00 1970 +0000 | |
134 @@ -3,0 +4,2 @@ | |
135 +step1 | |
136 +step2 | |
137 diff -r c8defeecf7a4 -r 171c6a79a27b file2.c | |
138 --- a/file2.c Thu Jan 01 00:00:10 1970 +0000 | |
139 +++ b/file2.c Thu Jan 01 00:00:00 1970 +0000 | |
140 @@ -0,0 +1,1 @@ | |
141 +step3 | |
142 | |
143 setup for example 7: amend an older changeset | |
144 $ echo 'fix fix oops fix' > file2.c | |
145 $ hg commit -u bob -d '3 0' -m 'fix bug 17' | |
146 $ echo 'cleanup' >> file1.c | |
147 $ hg commit -u bob -d '4 0' -m 'cleanup' | |
148 $ echo 'new feature' >> file1.c | |
149 $ hg commit -u bob -d '5 0' -m 'feature 23' | |
150 $ hg --hidden shortlog -G -r 10:: | |
151 @ 13:dadcbba2d606 draft feature 23 | |
152 | | |
153 o 12:debd46bb29dc draft cleanup | |
154 | | |
155 o 11:3e1cb8f70c02 draft fix bug 17 | |
156 | | |
157 o 10:171c6a79a27b draft fix bug 64 | |
158 | | |
159 | |
160 example 7: amend an older changeset (figures 6, 7) | |
161 $ hg update -q 11 | |
162 $ echo 'fix fix fix fix' > file2.c | |
163 $ hg amend -u bob -d '6 0' | |
164 2 new unstable changesets | |
165 $ hg shortlog -r 'obsolete()' | |
166 11:3e1cb8f70c02 draft fix bug 17 | |
167 $ hg shortlog -r 'unstable()' | |
168 12:debd46bb29dc draft cleanup | |
169 13:dadcbba2d606 draft feature 23 | |
170 $ hg --hidden shortlog -G -r 10:: | |
171 @ 15:395cbeda3a06 draft fix bug 17 | |
172 | | |
173 | x 14:f7fab707e247 draft temporary amend commit for 3e1cb8f70c02 | |
174 | | | |
175 | | o 13:dadcbba2d606 draft feature 23 | |
176 | | | | |
177 | | o 12:debd46bb29dc draft cleanup | |
178 | |/ | |
179 | x 11:3e1cb8f70c02 draft fix bug 17 | |
180 |/ | |
181 o 10:171c6a79a27b draft fix bug 64 | |
182 | | |
183 $ hg evolve -q --all | |
184 $ hg shortlog -G -r 10:: | |
185 @ 17:91b4b0f8b5c5 draft feature 23 | |
186 | | |
187 o 16:fe8858bd9bc2 draft cleanup | |
188 | | |
189 o 15:395cbeda3a06 draft fix bug 17 | |
190 | | |
191 o 10:171c6a79a27b draft fix bug 64 | |
192 | | |
193 | |
194 setup for example 8: prune an older changeset (figure 8) | |
195 $ echo 'useful' >> file1.c | |
196 $ hg commit -u carl -d '7 0' -m 'useful work' | |
197 $ echo 'debug' >> file2.c | |
198 $ hg commit -u carl -d '8 0' -m 'debug hack' | |
199 $ echo 'more useful' >> file1.c | |
200 $ hg commit -u carl -d '9 0' -m 'more work' | |
201 $ hg shortlog -G -r 17:: | |
202 @ 20:ea8fafca914b draft more work | |
203 | | |
204 o 19:b23d06b457a8 draft debug hack | |
205 | | |
206 o 18:1f33e68b18b9 draft useful work | |
207 | | |
208 o 17:91b4b0f8b5c5 draft feature 23 | |
209 | | |
210 | |
211 example 8: prune an older changeset (figures 8, 9) | |
212 $ hg prune 19 | |
213 1 changesets pruned | |
214 1 new unstable changesets | |
215 $ hg --hidden shortlog -G -r 18:: | |
216 @ 20:ea8fafca914b draft more work | |
217 | | |
218 x 19:b23d06b457a8 draft debug hack | |
219 | | |
220 o 18:1f33e68b18b9 draft useful work | |
221 | | |
1422
c868a69c29c5
evolve: distinct between '--all' and '--all --any'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
1239
diff
changeset
|
222 $ hg evolve -q --all --any |
978 | 223 $ hg --hidden shortlog -G -r 18:: |
224 @ 21:4393e5877437 draft more work | |
225 | | |
226 | x 20:ea8fafca914b draft more work | |
227 | | | |
228 | x 19:b23d06b457a8 draft debug hack | |
229 |/ | |
230 o 18:1f33e68b18b9 draft useful work | |
231 | | |
232 | |
233 example 9: uncommit files from an older changeset (discard changes) | |
234 (figure 10) | |
235 $ echo 'this fixes bug 53' >> file1.c | |
236 $ echo 'debug hack' >> file2.c | |
237 $ hg commit -u dan -d '11 0' -m 'fix bug 53' | |
238 $ echo 'and this handles bug 67' >> file1.c | |
239 $ hg commit -u dan -d '12 0' -m 'fix bug 67' | |
240 $ hg update 22 | |
241 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
242 $ hg shortlog -G -r 21:: | |
243 o 23:4db2428c8ae3 draft fix bug 67 | |
244 | | |
245 @ 22:f84357446753 draft fix bug 53 | |
246 | | |
247 o 21:4393e5877437 draft more work | |
248 | | |
249 $ hg uncommit file2.c | |
250 1 new unstable changesets | |
251 $ hg status | |
252 M file2.c | |
253 $ hg revert file2.c | |
1422
c868a69c29c5
evolve: distinct between '--all' and '--all --any'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
1239
diff
changeset
|
254 $ hg evolve --all --any |
978 | 255 move:[23] fix bug 67 |
256 atop:[24] fix bug 53 | |
1099
bac4e0bc9f6a
evolve: write a status message when the working directory changes
David Soria Parra <davidsp@fb.com>
parents:
978
diff
changeset
|
257 working directory is now at 0d972d6888e6 |
978 | 258 $ hg --hidden shortlog -G -r 21:: |
259 @ 25:0d972d6888e6 draft fix bug 67 | |
260 | | |
261 o 24:71bb83d674c5 draft fix bug 53 | |
262 | | |
263 | x 23:4db2428c8ae3 draft fix bug 67 | |
264 | | | |
265 | x 22:f84357446753 draft fix bug 53 | |
266 |/ | |
267 o 21:4393e5877437 draft more work | |
268 | | |
269 $ rm file2.c.orig | |
270 | |
271 example 10: uncommit files from an older changeset (keep changes) | |
272 (figures 11, 12) | |
273 $ echo 'fix a bug' >> file1.c | |
274 $ echo 'useful but unrelated' >> file2.c | |
275 $ hg commit -u dan -d '11 0' -m 'fix a bug' | |
276 $ echo 'new feature' >> file1.c | |
277 $ hg commit -u dan -d '12 0' -m 'new feature' | |
278 $ hg update 26 | |
279 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
280 $ hg --hidden shortlog -G -r 25:: | |
281 o 27:fbb3c6d50427 draft new feature | |
282 | | |
283 @ 26:5b31a1239ab9 draft fix a bug | |
284 | | |
285 o 25:0d972d6888e6 draft fix bug 67 | |
286 | | |
287 $ hg uncommit file2.c | |
288 1 new unstable changesets | |
289 $ hg status | |
290 M file2.c | |
291 $ hg commit -m 'useful tweak' | |
292 $ hg --hidden shortlog -G -r 25:: | |
293 @ 29:51e0d8c0a922 draft useful tweak | |
294 | | |
295 o 28:2594e98553a9 draft fix a bug | |
296 | | |
297 | o 27:fbb3c6d50427 draft new feature | |
298 | | | |
299 | x 26:5b31a1239ab9 draft fix a bug | |
300 |/ | |
301 o 25:0d972d6888e6 draft fix bug 67 | |
302 | | |
1422
c868a69c29c5
evolve: distinct between '--all' and '--all --any'
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
1239
diff
changeset
|
303 $ hg evolve --all --any |
978 | 304 move:[27] new feature |
305 atop:[28] fix a bug | |
1099
bac4e0bc9f6a
evolve: write a status message when the working directory changes
David Soria Parra <davidsp@fb.com>
parents:
978
diff
changeset
|
306 working directory is now at 166c1c368ab6 |
978 | 307 $ hg --hidden shortlog -G -r 25:: |
308 @ 30:166c1c368ab6 draft new feature | |
309 | | |
310 | o 29:51e0d8c0a922 draft useful tweak | |
311 |/ | |
312 o 28:2594e98553a9 draft fix a bug | |
313 | | |
314 | x 27:fbb3c6d50427 draft new feature | |
315 | | | |
316 | x 26:5b31a1239ab9 draft fix a bug | |
317 |/ | |
318 o 25:0d972d6888e6 draft fix bug 67 | |
319 | |