##// END OF EJS Templates
tests: add test showing how `hg fix -s` deals with obsolete and orphan nodes...
Martin von Zweigbergk -
r46399:e281a1ac default draft
parent child Browse files
Show More
@@ -1,521 +1,556
1 A script that implements uppercasing all letters in a file.
1 A script that implements uppercasing all letters in a file.
2
2
3 $ UPPERCASEPY="$TESTTMP/uppercase.py"
3 $ UPPERCASEPY="$TESTTMP/uppercase.py"
4 $ cat > $UPPERCASEPY <<EOF
4 $ cat > $UPPERCASEPY <<EOF
5 > import sys
5 > import sys
6 > from mercurial.utils.procutil import setbinary
6 > from mercurial.utils.procutil import setbinary
7 > setbinary(sys.stdin)
7 > setbinary(sys.stdin)
8 > setbinary(sys.stdout)
8 > setbinary(sys.stdout)
9 > sys.stdout.write(sys.stdin.read().upper())
9 > sys.stdout.write(sys.stdin.read().upper())
10 > EOF
10 > EOF
11 $ TESTLINES="foo\nbar\nbaz\n"
11 $ TESTLINES="foo\nbar\nbaz\n"
12 $ printf $TESTLINES | "$PYTHON" $UPPERCASEPY
12 $ printf $TESTLINES | "$PYTHON" $UPPERCASEPY
13 FOO
13 FOO
14 BAR
14 BAR
15 BAZ
15 BAZ
16
16
17 Tests for the fix extension's behavior around non-trivial history topologies.
17 Tests for the fix extension's behavior around non-trivial history topologies.
18 Looks for correct incremental fixing and reproduction of parent/child
18 Looks for correct incremental fixing and reproduction of parent/child
19 relationships. We indicate fixed file content by uppercasing it.
19 relationships. We indicate fixed file content by uppercasing it.
20
20
21 $ cat >> $HGRCPATH <<EOF
21 $ cat >> $HGRCPATH <<EOF
22 > [extensions]
22 > [extensions]
23 > fix =
23 > fix =
24 > strip =
24 > strip =
25 > debugdrawdag=$TESTDIR/drawdag.py
25 > [fix]
26 > [fix]
26 > uppercase-whole-file:command="$PYTHON" $UPPERCASEPY
27 > uppercase-whole-file:command="$PYTHON" $UPPERCASEPY
27 > uppercase-whole-file:pattern=set:**
28 > uppercase-whole-file:pattern=set:**
28 > EOF
29 > EOF
29
30
30 This tests the only behavior that should really be affected by obsolescence, so
31 This tests the only behavior that should really be affected by obsolescence, so
31 we'll test it with evolution off and on. This only changes the revision
32 we'll test it with evolution off and on. This only changes the revision
32 numbers, if all is well.
33 numbers, if all is well.
33
34
34 #testcases obsstore-off obsstore-on
35 #testcases obsstore-off obsstore-on
35 #if obsstore-on
36 #if obsstore-on
36 $ cat >> $HGRCPATH <<EOF
37 $ cat >> $HGRCPATH <<EOF
37 > [experimental]
38 > [experimental]
38 > evolution.createmarkers=True
39 > evolution.createmarkers=True
39 > evolution.allowunstable=True
40 > evolution.allowunstable=True
40 > EOF
41 > EOF
41 #endif
42 #endif
42
43
43 Setting up the test topology. Scroll down to see the graph produced. We make it
44 Setting up the test topology. Scroll down to see the graph produced. We make it
44 clear which files were modified in each revision. It's enough to test at the
45 clear which files were modified in each revision. It's enough to test at the
45 file granularity, because that demonstrates which baserevs were diffed against.
46 file granularity, because that demonstrates which baserevs were diffed against.
46 The computation of changed lines is orthogonal and tested separately.
47 The computation of changed lines is orthogonal and tested separately.
47
48
48 $ hg init repo
49 $ hg init repo
49 $ cd repo
50 $ cd repo
50
51
51 $ printf "aaaa\n" > a
52 $ printf "aaaa\n" > a
52 $ hg commit -Am "change A"
53 $ hg commit -Am "change A"
53 adding a
54 adding a
54 $ printf "bbbb\n" > b
55 $ printf "bbbb\n" > b
55 $ hg commit -Am "change B"
56 $ hg commit -Am "change B"
56 adding b
57 adding b
57 $ printf "cccc\n" > c
58 $ printf "cccc\n" > c
58 $ hg commit -Am "change C"
59 $ hg commit -Am "change C"
59 adding c
60 adding c
60 $ hg checkout 0
61 $ hg checkout 0
61 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
62 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
62 $ printf "dddd\n" > d
63 $ printf "dddd\n" > d
63 $ hg commit -Am "change D"
64 $ hg commit -Am "change D"
64 adding d
65 adding d
65 created new head
66 created new head
66 $ hg merge -r 2
67 $ hg merge -r 2
67 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
68 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
68 (branch merge, don't forget to commit)
69 (branch merge, don't forget to commit)
69 $ printf "eeee\n" > e
70 $ printf "eeee\n" > e
70 $ hg commit -Am "change E"
71 $ hg commit -Am "change E"
71 adding e
72 adding e
72 $ hg checkout 0
73 $ hg checkout 0
73 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
74 0 files updated, 0 files merged, 4 files removed, 0 files unresolved
74 $ printf "ffff\n" > f
75 $ printf "ffff\n" > f
75 $ hg commit -Am "change F"
76 $ hg commit -Am "change F"
76 adding f
77 adding f
77 created new head
78 created new head
78 $ hg checkout 0
79 $ hg checkout 0
79 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
80 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
80 $ printf "gggg\n" > g
81 $ printf "gggg\n" > g
81 $ hg commit -Am "change G"
82 $ hg commit -Am "change G"
82 adding g
83 adding g
83 created new head
84 created new head
84 $ hg merge -r 5
85 $ hg merge -r 5
85 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
86 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
86 (branch merge, don't forget to commit)
87 (branch merge, don't forget to commit)
87 $ printf "hhhh\n" > h
88 $ printf "hhhh\n" > h
88 $ hg commit -Am "change H (child of b53d63e816fb and 0e49f92ee6e9)"
89 $ hg commit -Am "change H (child of b53d63e816fb and 0e49f92ee6e9)"
89 adding h
90 adding h
90 $ hg merge -r 4
91 $ hg merge -r 4
91 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
92 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
92 (branch merge, don't forget to commit)
93 (branch merge, don't forget to commit)
93 $ printf "iiii\n" > i
94 $ printf "iiii\n" > i
94 $ hg commit -Am "change I"
95 $ hg commit -Am "change I"
95 adding i
96 adding i
96 $ hg checkout 2
97 $ hg checkout 2
97 0 files updated, 0 files merged, 6 files removed, 0 files unresolved
98 0 files updated, 0 files merged, 6 files removed, 0 files unresolved
98 $ printf "jjjj\n" > j
99 $ printf "jjjj\n" > j
99 $ hg commit -Am "change J (child of 7f371349286e)"
100 $ hg commit -Am "change J (child of 7f371349286e)"
100 adding j
101 adding j
101 created new head
102 created new head
102 $ hg checkout 7
103 $ hg checkout 7
103 3 files updated, 0 files merged, 3 files removed, 0 files unresolved
104 3 files updated, 0 files merged, 3 files removed, 0 files unresolved
104 $ printf "kkkk\n" > k
105 $ printf "kkkk\n" > k
105 $ hg add
106 $ hg add
106 adding k
107 adding k
107
108
108 $ hg log --graph --template '{rev}:{node|short} {desc}\n'
109 $ hg log --graph --template '{rev}:{node|short} {desc}\n'
109 o 9:884041ccc490 change J (child of 7f371349286e)
110 o 9:884041ccc490 change J (child of 7f371349286e)
110 |
111 |
111 | o 8:b7c772105fd2 change I
112 | o 8:b7c772105fd2 change I
112 | |\
113 | |\
113 | | @ 7:4e7b9312dad2 change H (child of b53d63e816fb and 0e49f92ee6e9)
114 | | @ 7:4e7b9312dad2 change H (child of b53d63e816fb and 0e49f92ee6e9)
114 | | |\
115 | | |\
115 | | | o 6:0e49f92ee6e9 change G
116 | | | o 6:0e49f92ee6e9 change G
116 | | | |
117 | | | |
117 | | o | 5:b53d63e816fb change F
118 | | o | 5:b53d63e816fb change F
118 | | |/
119 | | |/
119 | o | 4:ddad58af5e51 change E
120 | o | 4:ddad58af5e51 change E
120 |/| |
121 |/| |
121 | o | 3:c015ebfd2bfe change D
122 | o | 3:c015ebfd2bfe change D
122 | |/
123 | |/
123 o | 2:7f371349286e change C
124 o | 2:7f371349286e change C
124 | |
125 | |
125 o | 1:388fdd33fea0 change B
126 o | 1:388fdd33fea0 change B
126 |/
127 |/
127 o 0:a55a84d97a24 change A
128 o 0:a55a84d97a24 change A
128
129
129
130
130 Fix all but the root revision and its four children.
131 Fix all but the root revision and its four children.
131
132
132 $ hg fix -r '2|4|7|8|9' --working-dir
133 $ hg fix -r '2|4|7|8|9' --working-dir
133 saved backup bundle to * (glob) (obsstore-off !)
134 saved backup bundle to * (glob) (obsstore-off !)
134
135
135 The five revisions remain, but the other revisions were fixed and replaced. All
136 The five revisions remain, but the other revisions were fixed and replaced. All
136 parent pointers have been accurately set to reproduce the previous topology
137 parent pointers have been accurately set to reproduce the previous topology
137 (though it is rendered in a slightly different order now).
138 (though it is rendered in a slightly different order now).
138
139
139 #if obsstore-on
140 #if obsstore-on
140 $ hg log --graph --template '{rev}:{node|short} {desc}\n'
141 $ hg log --graph --template '{rev}:{node|short} {desc}\n'
141 o 14:d8d0e7974598 change J (child of 89de0da1d5da)
142 o 14:d8d0e7974598 change J (child of 89de0da1d5da)
142 |
143 |
143 | o 13:4fc0b354461e change I
144 | o 13:4fc0b354461e change I
144 | |\
145 | |\
145 | | @ 12:1c45f3923443 change H (child of b53d63e816fb and 0e49f92ee6e9)
146 | | @ 12:1c45f3923443 change H (child of b53d63e816fb and 0e49f92ee6e9)
146 | | |\
147 | | |\
147 | o | | 11:d75754455722 change E
148 | o | | 11:d75754455722 change E
148 |/| | |
149 |/| | |
149 o | | | 10:89de0da1d5da change C
150 o | | | 10:89de0da1d5da change C
150 | | | |
151 | | | |
151 | | | o 6:0e49f92ee6e9 change G
152 | | | o 6:0e49f92ee6e9 change G
152 | | | |
153 | | | |
153 | | o | 5:b53d63e816fb change F
154 | | o | 5:b53d63e816fb change F
154 | | |/
155 | | |/
155 | o / 3:c015ebfd2bfe change D
156 | o / 3:c015ebfd2bfe change D
156 | |/
157 | |/
157 o / 1:388fdd33fea0 change B
158 o / 1:388fdd33fea0 change B
158 |/
159 |/
159 o 0:a55a84d97a24 change A
160 o 0:a55a84d97a24 change A
160
161
161 $ C=10
162 $ C=10
162 $ E=11
163 $ E=11
163 $ H=12
164 $ H=12
164 $ I=13
165 $ I=13
165 $ J=14
166 $ J=14
166 #else
167 #else
167 $ hg log --graph --template '{rev}:{node|short} {desc}\n'
168 $ hg log --graph --template '{rev}:{node|short} {desc}\n'
168 o 9:d8d0e7974598 change J (child of 89de0da1d5da)
169 o 9:d8d0e7974598 change J (child of 89de0da1d5da)
169 |
170 |
170 | o 8:4fc0b354461e change I
171 | o 8:4fc0b354461e change I
171 | |\
172 | |\
172 | | @ 7:1c45f3923443 change H (child of b53d63e816fb and 0e49f92ee6e9)
173 | | @ 7:1c45f3923443 change H (child of b53d63e816fb and 0e49f92ee6e9)
173 | | |\
174 | | |\
174 | o | | 6:d75754455722 change E
175 | o | | 6:d75754455722 change E
175 |/| | |
176 |/| | |
176 o | | | 5:89de0da1d5da change C
177 o | | | 5:89de0da1d5da change C
177 | | | |
178 | | | |
178 | | | o 4:0e49f92ee6e9 change G
179 | | | o 4:0e49f92ee6e9 change G
179 | | | |
180 | | | |
180 | | o | 3:b53d63e816fb change F
181 | | o | 3:b53d63e816fb change F
181 | | |/
182 | | |/
182 | o / 2:c015ebfd2bfe change D
183 | o / 2:c015ebfd2bfe change D
183 | |/
184 | |/
184 o / 1:388fdd33fea0 change B
185 o / 1:388fdd33fea0 change B
185 |/
186 |/
186 o 0:a55a84d97a24 change A
187 o 0:a55a84d97a24 change A
187
188
188 $ C=5
189 $ C=5
189 $ E=6
190 $ E=6
190 $ H=7
191 $ H=7
191 $ I=8
192 $ I=8
192 $ J=9
193 $ J=9
193 #endif
194 #endif
194
195
195 Change C is a root of the set being fixed, so all we fix is what has changed
196 Change C is a root of the set being fixed, so all we fix is what has changed
196 since its parent. That parent, change B, is its baserev.
197 since its parent. That parent, change B, is its baserev.
197
198
198 $ hg cat -r $C 'set:**'
199 $ hg cat -r $C 'set:**'
199 aaaa
200 aaaa
200 bbbb
201 bbbb
201 CCCC
202 CCCC
202
203
203 Change E is a merge with only one parent being fixed. Its baserevs are the
204 Change E is a merge with only one parent being fixed. Its baserevs are the
204 unfixed parent plus the baserevs of the other parent. This evaluates to changes
205 unfixed parent plus the baserevs of the other parent. This evaluates to changes
205 B and D. We now have to decide what it means to incrementally fix a merge
206 B and D. We now have to decide what it means to incrementally fix a merge
206 commit. We choose to fix anything that has changed versus any baserev. Only the
207 commit. We choose to fix anything that has changed versus any baserev. Only the
207 undisturbed content of the common ancestor, change A, is unfixed.
208 undisturbed content of the common ancestor, change A, is unfixed.
208
209
209 $ hg cat -r $E 'set:**'
210 $ hg cat -r $E 'set:**'
210 aaaa
211 aaaa
211 BBBB
212 BBBB
212 CCCC
213 CCCC
213 DDDD
214 DDDD
214 EEEE
215 EEEE
215
216
216 Change H is a merge with neither parent being fixed. This is essentially
217 Change H is a merge with neither parent being fixed. This is essentially
217 equivalent to the previous case because there is still only one baserev for
218 equivalent to the previous case because there is still only one baserev for
218 each parent of the merge.
219 each parent of the merge.
219
220
220 $ hg cat -r $H 'set:**'
221 $ hg cat -r $H 'set:**'
221 aaaa
222 aaaa
222 FFFF
223 FFFF
223 GGGG
224 GGGG
224 HHHH
225 HHHH
225
226
226 Change I is a merge that has four baserevs; two from each parent. We handle
227 Change I is a merge that has four baserevs; two from each parent. We handle
227 multiple baserevs in the same way regardless of how many came from each parent.
228 multiple baserevs in the same way regardless of how many came from each parent.
228 So, fixing change H will fix any files that were not exactly the same in each
229 So, fixing change H will fix any files that were not exactly the same in each
229 baserev.
230 baserev.
230
231
231 $ hg cat -r $I 'set:**'
232 $ hg cat -r $I 'set:**'
232 aaaa
233 aaaa
233 BBBB
234 BBBB
234 CCCC
235 CCCC
235 DDDD
236 DDDD
236 EEEE
237 EEEE
237 FFFF
238 FFFF
238 GGGG
239 GGGG
239 HHHH
240 HHHH
240 IIII
241 IIII
241
242
242 Change J is a simple case with one baserev, but its baserev is not its parent,
243 Change J is a simple case with one baserev, but its baserev is not its parent,
243 change C. Its baserev is its grandparent, change B.
244 change C. Its baserev is its grandparent, change B.
244
245
245 $ hg cat -r $J 'set:**'
246 $ hg cat -r $J 'set:**'
246 aaaa
247 aaaa
247 bbbb
248 bbbb
248 CCCC
249 CCCC
249 JJJJ
250 JJJJ
250
251
251 The working copy was dirty, so it is treated much like a revision. The baserevs
252 The working copy was dirty, so it is treated much like a revision. The baserevs
252 for the working copy are inherited from its parent, change H, because it is
253 for the working copy are inherited from its parent, change H, because it is
253 also being fixed.
254 also being fixed.
254
255
255 $ cat *
256 $ cat *
256 aaaa
257 aaaa
257 FFFF
258 FFFF
258 GGGG
259 GGGG
259 HHHH
260 HHHH
260 KKKK
261 KKKK
261
262
262 Change A was never a baserev because none of its children were to be fixed.
263 Change A was never a baserev because none of its children were to be fixed.
263
264
264 $ cd ..
265 $ cd ..
265
266
266
267
267 Test the --source option. We only do this with obsstore on to avoid duplicating
268 Test the --source option. We only do this with obsstore on to avoid duplicating
268 test code. We rely on the other tests to prove that obsolescence is not an
269 test code. We rely on the other tests to prove that obsolescence is not an
269 important factor here.
270 important factor here.
270
271
271 #if obsstore-on
272 #if obsstore-on
272 $ hg init source-arg
273 $ hg init source-arg
273 $ cd source-arg
274 $ cd source-arg
274 $ printf "aaaa\n" > a
275 $ printf "aaaa\n" > a
275 $ hg commit -Am "change A"
276 $ hg commit -Am "change A"
276 adding a
277 adding a
277 $ printf "bbbb\n" > b
278 $ printf "bbbb\n" > b
278 $ hg commit -Am "change B"
279 $ hg commit -Am "change B"
279 adding b
280 adding b
280 $ printf "cccc\n" > c
281 $ printf "cccc\n" > c
281 $ hg commit -Am "change C"
282 $ hg commit -Am "change C"
282 adding c
283 adding c
283 $ hg checkout 0
284 $ hg checkout 0
284 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
285 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
285 $ printf "dddd\n" > d
286 $ printf "dddd\n" > d
286 $ hg commit -Am "change D"
287 $ hg commit -Am "change D"
287 adding d
288 adding d
288 created new head
289 created new head
289 $ hg log --graph --template '{rev} {desc}\n'
290 $ hg log --graph --template '{rev} {desc}\n'
290 @ 3 change D
291 @ 3 change D
291 |
292 |
292 | o 2 change C
293 | o 2 change C
293 | |
294 | |
294 | o 1 change B
295 | o 1 change B
295 |/
296 |/
296 o 0 change A
297 o 0 change A
297
298
298
299
299 Test passing 'wdir()' to --source
300 Test passing 'wdir()' to --source
300 $ printf "xxxx\n" > x
301 $ printf "xxxx\n" > x
301 $ hg add x
302 $ hg add x
302 $ hg fix -s 'wdir()'
303 $ hg fix -s 'wdir()'
303 $ cat *
304 $ cat *
304 aaaa
305 aaaa
305 dddd
306 dddd
306 XXXX
307 XXXX
307
308
308 Test passing '.' to --source
309 Test passing '.' to --source
309 $ printf "xxxx\n" > x
310 $ printf "xxxx\n" > x
310 $ hg fix -s .
311 $ hg fix -s .
311 $ hg log --graph --template '{rev} {desc}\n'
312 $ hg log --graph --template '{rev} {desc}\n'
312 @ 4 change D
313 @ 4 change D
313 |
314 |
314 | o 2 change C
315 | o 2 change C
315 | |
316 | |
316 | o 1 change B
317 | o 1 change B
317 |/
318 |/
318 o 0 change A
319 o 0 change A
319
320
320 $ cat *
321 $ cat *
321 aaaa
322 aaaa
322 DDDD
323 DDDD
323 XXXX
324 XXXX
324 $ hg strip -qf 4
325 $ hg strip -qf 4
325 $ hg co -q 3
326 $ hg co -q 3
326
327
327 Test passing other branch to --source
328 Test passing other branch to --source
328 $ printf "xxxx\n" > x
329 $ printf "xxxx\n" > x
329 $ hg add x
330 $ hg add x
330 $ hg fix -s 2
331 $ hg fix -s 2
331 $ hg log --graph --template '{rev} {desc}\n'
332 $ hg log --graph --template '{rev} {desc}\n'
332 o 4 change C
333 o 4 change C
333 |
334 |
334 | @ 3 change D
335 | @ 3 change D
335 | |
336 | |
336 o | 1 change B
337 o | 1 change B
337 |/
338 |/
338 o 0 change A
339 o 0 change A
339
340
340 $ hg cat -r 4 b c
341 $ hg cat -r 4 b c
341 bbbb
342 bbbb
342 CCCC
343 CCCC
343 $ cat *
344 $ cat *
344 aaaa
345 aaaa
345 dddd
346 dddd
346 xxxx
347 xxxx
347 $ hg strip -qf 4
348 $ hg strip -qf 4
348
349
349 Test passing multiple revisions to --source
350 Test passing multiple revisions to --source
350 $ hg fix -s '2 + .'
351 $ hg fix -s '2 + .'
351 $ hg log --graph --template '{rev} {desc}\n'
352 $ hg log --graph --template '{rev} {desc}\n'
352 @ 5 change D
353 @ 5 change D
353 |
354 |
354 | o 4 change C
355 | o 4 change C
355 | |
356 | |
356 | o 1 change B
357 | o 1 change B
357 |/
358 |/
358 o 0 change A
359 o 0 change A
359
360
360 $ hg cat -r 4 b c
361 $ hg cat -r 4 b c
361 bbbb
362 bbbb
362 CCCC
363 CCCC
363 $ cat *
364 $ cat *
364 aaaa
365 aaaa
365 DDDD
366 DDDD
366 XXXX
367 XXXX
367
368
368 $ cd ..
369 $ cd ..
370
371 $ hg init exclude-obsolete
372 $ cd exclude-obsolete
373 $ hg debugdrawdag <<'EOS'
374 > E C # prune: C
375 > | |
376 > D B # prune: B, D
377 > |/
378 > A
379 > EOS
380 1 new orphan changesets
381 $ hg log --graph --template '{rev} {desc}\n'
382 * 4 E
383 |
384 | x 3 C
385 | |
386 x | 2 D
387 | |
388 | x 1 B
389 |/
390 o 0 A
391
392 $ hg fix -s A
393 abort: fixing obsolete revision could cause divergence
394 [255]
395 $ hg fix -s B
396 abort: fixing obsolete revision could cause divergence
397 [255]
398 $ hg fix -s D
399 abort: fixing obsolete revision could cause divergence
400 [255]
401 $ hg fix -s E
402 $ cd ..
403
369 #endif
404 #endif
370
405
371 The --all flag should fix anything that wouldn't cause a problem if you fixed
406 The --all flag should fix anything that wouldn't cause a problem if you fixed
372 it, including the working copy. Obsolete revisions are not fixed because that
407 it, including the working copy. Obsolete revisions are not fixed because that
373 could cause divergence. Public revisions would cause an abort because they are
408 could cause divergence. Public revisions would cause an abort because they are
374 immutable. We can fix orphans because their successors are still just orphans
409 immutable. We can fix orphans because their successors are still just orphans
375 of the original obsolete parent. When obsolesence is off, we're just fixing and
410 of the original obsolete parent. When obsolesence is off, we're just fixing and
376 replacing anything that isn't public.
411 replacing anything that isn't public.
377
412
378 $ hg init fixall
413 $ hg init fixall
379 $ cd fixall
414 $ cd fixall
380 $ hg fix --all --working-dir
415 $ hg fix --all --working-dir
381 abort: cannot specify both --working-dir and --all
416 abort: cannot specify both --working-dir and --all
382 [255]
417 [255]
383
418
384 #if obsstore-on
419 #if obsstore-on
385 $ printf "one\n" > foo.whole
420 $ printf "one\n" > foo.whole
386 $ hg commit -Aqm "first"
421 $ hg commit -Aqm "first"
387 $ hg phase --public
422 $ hg phase --public
388 $ hg tag --local root
423 $ hg tag --local root
389 $ printf "two\n" > foo.whole
424 $ printf "two\n" > foo.whole
390 $ hg commit -m "second"
425 $ hg commit -m "second"
391 $ printf "three\n" > foo.whole
426 $ printf "three\n" > foo.whole
392 $ hg commit -m "third" --secret
427 $ hg commit -m "third" --secret
393 $ hg tag --local secret
428 $ hg tag --local secret
394 $ hg checkout root
429 $ hg checkout root
395 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
430 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
396 $ printf "four\n" > foo.whole
431 $ printf "four\n" > foo.whole
397 $ hg commit -m "fourth"
432 $ hg commit -m "fourth"
398 created new head
433 created new head
399 $ printf "five\n" > foo.whole
434 $ printf "five\n" > foo.whole
400 $ hg commit -m "fifth"
435 $ hg commit -m "fifth"
401 $ hg tag --local replaced
436 $ hg tag --local replaced
402 $ printf "six\n" > foo.whole
437 $ printf "six\n" > foo.whole
403 $ hg commit -m "sixth"
438 $ hg commit -m "sixth"
404 $ hg checkout replaced
439 $ hg checkout replaced
405 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
440 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
406 $ printf "seven\n" > foo.whole
441 $ printf "seven\n" > foo.whole
407 $ hg commit --amend
442 $ hg commit --amend
408 1 new orphan changesets
443 1 new orphan changesets
409 $ hg checkout secret
444 $ hg checkout secret
410 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
445 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
411 $ printf "uncommitted\n" > foo.whole
446 $ printf "uncommitted\n" > foo.whole
412
447
413 $ hg log --graph --template '{rev} {desc} {phase}\n'
448 $ hg log --graph --template '{rev} {desc} {phase}\n'
414 o 6 fifth draft
449 o 6 fifth draft
415 |
450 |
416 | * 5 sixth draft
451 | * 5 sixth draft
417 | |
452 | |
418 | x 4 fifth draft
453 | x 4 fifth draft
419 |/
454 |/
420 o 3 fourth draft
455 o 3 fourth draft
421 |
456 |
422 | @ 2 third secret
457 | @ 2 third secret
423 | |
458 | |
424 | o 1 second draft
459 | o 1 second draft
425 |/
460 |/
426 o 0 first public
461 o 0 first public
427
462
428
463
429 $ hg fix --all
464 $ hg fix --all
430
465
431 $ hg log --graph --template '{rev} {desc}\n' -r 'sort(all(), topo)' --hidden
466 $ hg log --graph --template '{rev} {desc}\n' -r 'sort(all(), topo)' --hidden
432 o 11 fifth
467 o 11 fifth
433 |
468 |
434 o 9 fourth
469 o 9 fourth
435 |
470 |
436 | @ 8 third
471 | @ 8 third
437 | |
472 | |
438 | o 7 second
473 | o 7 second
439 |/
474 |/
440 | * 10 sixth
475 | * 10 sixth
441 | |
476 | |
442 | | x 5 sixth
477 | | x 5 sixth
443 | |/
478 | |/
444 | x 4 fifth
479 | x 4 fifth
445 | |
480 | |
446 | | x 6 fifth
481 | | x 6 fifth
447 | |/
482 | |/
448 | x 3 fourth
483 | x 3 fourth
449 |/
484 |/
450 | x 2 third
485 | x 2 third
451 | |
486 | |
452 | x 1 second
487 | x 1 second
453 |/
488 |/
454 o 0 first
489 o 0 first
455
490
456
491
457 $ hg cat -r 7 foo.whole
492 $ hg cat -r 7 foo.whole
458 TWO
493 TWO
459 $ hg cat -r 8 foo.whole
494 $ hg cat -r 8 foo.whole
460 THREE
495 THREE
461 $ hg cat -r 9 foo.whole
496 $ hg cat -r 9 foo.whole
462 FOUR
497 FOUR
463 $ hg cat -r 10 foo.whole
498 $ hg cat -r 10 foo.whole
464 SIX
499 SIX
465 $ hg cat -r 11 foo.whole
500 $ hg cat -r 11 foo.whole
466 SEVEN
501 SEVEN
467 $ cat foo.whole
502 $ cat foo.whole
468 UNCOMMITTED
503 UNCOMMITTED
469 #else
504 #else
470 $ printf "one\n" > foo.whole
505 $ printf "one\n" > foo.whole
471 $ hg commit -Aqm "first"
506 $ hg commit -Aqm "first"
472 $ hg phase --public
507 $ hg phase --public
473 $ hg tag --local root
508 $ hg tag --local root
474 $ printf "two\n" > foo.whole
509 $ printf "two\n" > foo.whole
475 $ hg commit -m "second"
510 $ hg commit -m "second"
476 $ printf "three\n" > foo.whole
511 $ printf "three\n" > foo.whole
477 $ hg commit -m "third" --secret
512 $ hg commit -m "third" --secret
478 $ hg tag --local secret
513 $ hg tag --local secret
479 $ hg checkout root
514 $ hg checkout root
480 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
515 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
481 $ printf "four\n" > foo.whole
516 $ printf "four\n" > foo.whole
482 $ hg commit -m "fourth"
517 $ hg commit -m "fourth"
483 created new head
518 created new head
484 $ printf "uncommitted\n" > foo.whole
519 $ printf "uncommitted\n" > foo.whole
485
520
486 $ hg log --graph --template '{rev} {desc} {phase}\n'
521 $ hg log --graph --template '{rev} {desc} {phase}\n'
487 @ 3 fourth draft
522 @ 3 fourth draft
488 |
523 |
489 | o 2 third secret
524 | o 2 third secret
490 | |
525 | |
491 | o 1 second draft
526 | o 1 second draft
492 |/
527 |/
493 o 0 first public
528 o 0 first public
494
529
495
530
496 $ hg fix --all
531 $ hg fix --all
497 saved backup bundle to * (glob)
532 saved backup bundle to * (glob)
498
533
499 $ hg log --graph --template '{rev} {desc} {phase}\n'
534 $ hg log --graph --template '{rev} {desc} {phase}\n'
500 @ 3 fourth draft
535 @ 3 fourth draft
501 |
536 |
502 | o 2 third secret
537 | o 2 third secret
503 | |
538 | |
504 | o 1 second draft
539 | o 1 second draft
505 |/
540 |/
506 o 0 first public
541 o 0 first public
507
542
508 $ hg cat -r 0 foo.whole
543 $ hg cat -r 0 foo.whole
509 one
544 one
510 $ hg cat -r 1 foo.whole
545 $ hg cat -r 1 foo.whole
511 TWO
546 TWO
512 $ hg cat -r 2 foo.whole
547 $ hg cat -r 2 foo.whole
513 THREE
548 THREE
514 $ hg cat -r 3 foo.whole
549 $ hg cat -r 3 foo.whole
515 FOUR
550 FOUR
516 $ cat foo.whole
551 $ cat foo.whole
517 UNCOMMITTED
552 UNCOMMITTED
518 #endif
553 #endif
519
554
520 $ cd ..
555 $ cd ..
521
556
General Comments 0
You need to be logged in to leave comments. Login now