##// END OF EJS Templates
tests: add test for issue5678...
Martin von Zweigbergk -
r34178:b5d7e7d5 stable
parent child Browse files
Show More
@@ -1,949 +1,983 b''
1 $ cat >> $HGRCPATH <<EOF
1 $ cat >> $HGRCPATH <<EOF
2 > [extensions]
2 > [extensions]
3 > rebase=
3 > rebase=
4 > drawdag=$TESTDIR/drawdag.py
4 > drawdag=$TESTDIR/drawdag.py
5 >
5 >
6 > [phases]
6 > [phases]
7 > publish=False
7 > publish=False
8 >
8 >
9 > [alias]
9 > [alias]
10 > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
10 > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
11 > EOF
11 > EOF
12
12
13
13
14 $ hg init a
14 $ hg init a
15 $ cd a
15 $ cd a
16 $ hg unbundle "$TESTDIR/bundles/rebase.hg"
16 $ hg unbundle "$TESTDIR/bundles/rebase.hg"
17 adding changesets
17 adding changesets
18 adding manifests
18 adding manifests
19 adding file changes
19 adding file changes
20 added 8 changesets with 7 changes to 7 files (+2 heads)
20 added 8 changesets with 7 changes to 7 files (+2 heads)
21 (run 'hg heads' to see heads, 'hg merge' to merge)
21 (run 'hg heads' to see heads, 'hg merge' to merge)
22 $ hg up tip
22 $ hg up tip
23 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
23 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
24 $ cd ..
24 $ cd ..
25
25
26
26
27 Rebasing
27 Rebasing
28 D onto H - simple rebase:
28 D onto H - simple rebase:
29 (this also tests that editor is invoked if '--edit' is specified, and that we
29 (this also tests that editor is invoked if '--edit' is specified, and that we
30 can abort or warn for colliding untracked files)
30 can abort or warn for colliding untracked files)
31
31
32 $ hg clone -q -u . a a1
32 $ hg clone -q -u . a a1
33 $ cd a1
33 $ cd a1
34
34
35 $ hg tglog
35 $ hg tglog
36 @ 7: 'H'
36 @ 7: 'H'
37 |
37 |
38 | o 6: 'G'
38 | o 6: 'G'
39 |/|
39 |/|
40 o | 5: 'F'
40 o | 5: 'F'
41 | |
41 | |
42 | o 4: 'E'
42 | o 4: 'E'
43 |/
43 |/
44 | o 3: 'D'
44 | o 3: 'D'
45 | |
45 | |
46 | o 2: 'C'
46 | o 2: 'C'
47 | |
47 | |
48 | o 1: 'B'
48 | o 1: 'B'
49 |/
49 |/
50 o 0: 'A'
50 o 0: 'A'
51
51
52
52
53 $ hg status --rev "3^1" --rev 3
53 $ hg status --rev "3^1" --rev 3
54 A D
54 A D
55 $ echo collide > D
55 $ echo collide > D
56 $ HGEDITOR=cat hg rebase -s 3 -d 7 --edit --config merge.checkunknown=warn
56 $ HGEDITOR=cat hg rebase -s 3 -d 7 --edit --config merge.checkunknown=warn
57 rebasing 3:32af7686d403 "D"
57 rebasing 3:32af7686d403 "D"
58 D: replacing untracked file
58 D: replacing untracked file
59 D
59 D
60
60
61
61
62 HG: Enter commit message. Lines beginning with 'HG:' are removed.
62 HG: Enter commit message. Lines beginning with 'HG:' are removed.
63 HG: Leave message empty to abort commit.
63 HG: Leave message empty to abort commit.
64 HG: --
64 HG: --
65 HG: user: Nicolas Dumazet <nicdumz.commits@gmail.com>
65 HG: user: Nicolas Dumazet <nicdumz.commits@gmail.com>
66 HG: branch 'default'
66 HG: branch 'default'
67 HG: added D
67 HG: added D
68 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/32af7686d403-6f7dface-rebase.hg (glob)
68 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/32af7686d403-6f7dface-rebase.hg (glob)
69 $ cat D.orig
69 $ cat D.orig
70 collide
70 collide
71 $ rm D.orig
71 $ rm D.orig
72
72
73 $ hg tglog
73 $ hg tglog
74 o 7: 'D'
74 o 7: 'D'
75 |
75 |
76 @ 6: 'H'
76 @ 6: 'H'
77 |
77 |
78 | o 5: 'G'
78 | o 5: 'G'
79 |/|
79 |/|
80 o | 4: 'F'
80 o | 4: 'F'
81 | |
81 | |
82 | o 3: 'E'
82 | o 3: 'E'
83 |/
83 |/
84 | o 2: 'C'
84 | o 2: 'C'
85 | |
85 | |
86 | o 1: 'B'
86 | o 1: 'B'
87 |/
87 |/
88 o 0: 'A'
88 o 0: 'A'
89
89
90 $ cd ..
90 $ cd ..
91
91
92
92
93 D onto F - intermediate point:
93 D onto F - intermediate point:
94 (this also tests that editor is not invoked if '--edit' is not specified, and
94 (this also tests that editor is not invoked if '--edit' is not specified, and
95 that we can ignore for colliding untracked files)
95 that we can ignore for colliding untracked files)
96
96
97 $ hg clone -q -u . a a2
97 $ hg clone -q -u . a a2
98 $ cd a2
98 $ cd a2
99 $ echo collide > D
99 $ echo collide > D
100
100
101 $ HGEDITOR=cat hg rebase -s 3 -d 5 --config merge.checkunknown=ignore
101 $ HGEDITOR=cat hg rebase -s 3 -d 5 --config merge.checkunknown=ignore
102 rebasing 3:32af7686d403 "D"
102 rebasing 3:32af7686d403 "D"
103 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/32af7686d403-6f7dface-rebase.hg (glob)
103 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/32af7686d403-6f7dface-rebase.hg (glob)
104 $ cat D.orig
104 $ cat D.orig
105 collide
105 collide
106 $ rm D.orig
106 $ rm D.orig
107
107
108 $ hg tglog
108 $ hg tglog
109 o 7: 'D'
109 o 7: 'D'
110 |
110 |
111 | @ 6: 'H'
111 | @ 6: 'H'
112 |/
112 |/
113 | o 5: 'G'
113 | o 5: 'G'
114 |/|
114 |/|
115 o | 4: 'F'
115 o | 4: 'F'
116 | |
116 | |
117 | o 3: 'E'
117 | o 3: 'E'
118 |/
118 |/
119 | o 2: 'C'
119 | o 2: 'C'
120 | |
120 | |
121 | o 1: 'B'
121 | o 1: 'B'
122 |/
122 |/
123 o 0: 'A'
123 o 0: 'A'
124
124
125 $ cd ..
125 $ cd ..
126
126
127
127
128 E onto H - skip of G:
128 E onto H - skip of G:
129 (this also tests that we can overwrite untracked files and don't create backups
129 (this also tests that we can overwrite untracked files and don't create backups
130 if they have the same contents)
130 if they have the same contents)
131
131
132 $ hg clone -q -u . a a3
132 $ hg clone -q -u . a a3
133 $ cd a3
133 $ cd a3
134 $ hg cat -r 4 E | tee E
134 $ hg cat -r 4 E | tee E
135 E
135 E
136
136
137 $ hg rebase -s 4 -d 7
137 $ hg rebase -s 4 -d 7
138 rebasing 4:9520eea781bc "E"
138 rebasing 4:9520eea781bc "E"
139 rebasing 6:eea13746799a "G"
139 rebasing 6:eea13746799a "G"
140 note: rebase of 6:eea13746799a created no changes to commit
140 note: rebase of 6:eea13746799a created no changes to commit
141 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/9520eea781bc-fcd8edd4-rebase.hg (glob)
141 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/9520eea781bc-fcd8edd4-rebase.hg (glob)
142 $ f E.orig
142 $ f E.orig
143 E.orig: file not found
143 E.orig: file not found
144
144
145 $ hg tglog
145 $ hg tglog
146 o 6: 'E'
146 o 6: 'E'
147 |
147 |
148 @ 5: 'H'
148 @ 5: 'H'
149 |
149 |
150 o 4: 'F'
150 o 4: 'F'
151 |
151 |
152 | o 3: 'D'
152 | o 3: 'D'
153 | |
153 | |
154 | o 2: 'C'
154 | o 2: 'C'
155 | |
155 | |
156 | o 1: 'B'
156 | o 1: 'B'
157 |/
157 |/
158 o 0: 'A'
158 o 0: 'A'
159
159
160 $ cd ..
160 $ cd ..
161
161
162
162
163 F onto E - rebase of a branching point (skip G):
163 F onto E - rebase of a branching point (skip G):
164
164
165 $ hg clone -q -u . a a4
165 $ hg clone -q -u . a a4
166 $ cd a4
166 $ cd a4
167
167
168 $ hg rebase -s 5 -d 4
168 $ hg rebase -s 5 -d 4
169 rebasing 5:24b6387c8c8c "F"
169 rebasing 5:24b6387c8c8c "F"
170 rebasing 6:eea13746799a "G"
170 rebasing 6:eea13746799a "G"
171 note: rebase of 6:eea13746799a created no changes to commit
171 note: rebase of 6:eea13746799a created no changes to commit
172 rebasing 7:02de42196ebe "H" (tip)
172 rebasing 7:02de42196ebe "H" (tip)
173 saved backup bundle to $TESTTMP/a4/.hg/strip-backup/24b6387c8c8c-c3fe765d-rebase.hg (glob)
173 saved backup bundle to $TESTTMP/a4/.hg/strip-backup/24b6387c8c8c-c3fe765d-rebase.hg (glob)
174
174
175 $ hg tglog
175 $ hg tglog
176 @ 6: 'H'
176 @ 6: 'H'
177 |
177 |
178 o 5: 'F'
178 o 5: 'F'
179 |
179 |
180 o 4: 'E'
180 o 4: 'E'
181 |
181 |
182 | o 3: 'D'
182 | o 3: 'D'
183 | |
183 | |
184 | o 2: 'C'
184 | o 2: 'C'
185 | |
185 | |
186 | o 1: 'B'
186 | o 1: 'B'
187 |/
187 |/
188 o 0: 'A'
188 o 0: 'A'
189
189
190 $ cd ..
190 $ cd ..
191
191
192
192
193 G onto H - merged revision having a parent in ancestors of target:
193 G onto H - merged revision having a parent in ancestors of target:
194
194
195 $ hg clone -q -u . a a5
195 $ hg clone -q -u . a a5
196 $ cd a5
196 $ cd a5
197
197
198 $ hg rebase -s 6 -d 7
198 $ hg rebase -s 6 -d 7
199 rebasing 6:eea13746799a "G"
199 rebasing 6:eea13746799a "G"
200 saved backup bundle to $TESTTMP/a5/.hg/strip-backup/eea13746799a-883828ed-rebase.hg (glob)
200 saved backup bundle to $TESTTMP/a5/.hg/strip-backup/eea13746799a-883828ed-rebase.hg (glob)
201
201
202 $ hg tglog
202 $ hg tglog
203 o 7: 'G'
203 o 7: 'G'
204 |\
204 |\
205 | @ 6: 'H'
205 | @ 6: 'H'
206 | |
206 | |
207 | o 5: 'F'
207 | o 5: 'F'
208 | |
208 | |
209 o | 4: 'E'
209 o | 4: 'E'
210 |/
210 |/
211 | o 3: 'D'
211 | o 3: 'D'
212 | |
212 | |
213 | o 2: 'C'
213 | o 2: 'C'
214 | |
214 | |
215 | o 1: 'B'
215 | o 1: 'B'
216 |/
216 |/
217 o 0: 'A'
217 o 0: 'A'
218
218
219 $ cd ..
219 $ cd ..
220
220
221
221
222 F onto B - G maintains E as parent:
222 F onto B - G maintains E as parent:
223
223
224 $ hg clone -q -u . a a6
224 $ hg clone -q -u . a a6
225 $ cd a6
225 $ cd a6
226
226
227 $ hg rebase -s 5 -d 1
227 $ hg rebase -s 5 -d 1
228 rebasing 5:24b6387c8c8c "F"
228 rebasing 5:24b6387c8c8c "F"
229 rebasing 6:eea13746799a "G"
229 rebasing 6:eea13746799a "G"
230 rebasing 7:02de42196ebe "H" (tip)
230 rebasing 7:02de42196ebe "H" (tip)
231 saved backup bundle to $TESTTMP/a6/.hg/strip-backup/24b6387c8c8c-c3fe765d-rebase.hg (glob)
231 saved backup bundle to $TESTTMP/a6/.hg/strip-backup/24b6387c8c8c-c3fe765d-rebase.hg (glob)
232
232
233 $ hg tglog
233 $ hg tglog
234 @ 7: 'H'
234 @ 7: 'H'
235 |
235 |
236 | o 6: 'G'
236 | o 6: 'G'
237 |/|
237 |/|
238 o | 5: 'F'
238 o | 5: 'F'
239 | |
239 | |
240 | o 4: 'E'
240 | o 4: 'E'
241 | |
241 | |
242 | | o 3: 'D'
242 | | o 3: 'D'
243 | | |
243 | | |
244 +---o 2: 'C'
244 +---o 2: 'C'
245 | |
245 | |
246 o | 1: 'B'
246 o | 1: 'B'
247 |/
247 |/
248 o 0: 'A'
248 o 0: 'A'
249
249
250 $ cd ..
250 $ cd ..
251
251
252
252
253 These will fail (using --source):
253 These will fail (using --source):
254
254
255 G onto F - rebase onto an ancestor:
255 G onto F - rebase onto an ancestor:
256
256
257 $ hg clone -q -u . a a7
257 $ hg clone -q -u . a a7
258 $ cd a7
258 $ cd a7
259
259
260 $ hg rebase -s 6 -d 5
260 $ hg rebase -s 6 -d 5
261 nothing to rebase
261 nothing to rebase
262 [1]
262 [1]
263
263
264 F onto G - rebase onto a descendant:
264 F onto G - rebase onto a descendant:
265
265
266 $ hg rebase -s 5 -d 6
266 $ hg rebase -s 5 -d 6
267 abort: source is ancestor of destination
267 abort: source is ancestor of destination
268 [255]
268 [255]
269
269
270 G onto B - merge revision with both parents not in ancestors of target:
270 G onto B - merge revision with both parents not in ancestors of target:
271
271
272 $ hg rebase -s 6 -d 1
272 $ hg rebase -s 6 -d 1
273 rebasing 6:eea13746799a "G"
273 rebasing 6:eea13746799a "G"
274 abort: cannot use revision 6 as base, result would have 3 parents
274 abort: cannot use revision 6 as base, result would have 3 parents
275 [255]
275 [255]
276 $ hg rebase --abort
276 $ hg rebase --abort
277 rebase aborted
277 rebase aborted
278
278
279 These will abort gracefully (using --base):
279 These will abort gracefully (using --base):
280
280
281 G onto G - rebase onto same changeset:
281 G onto G - rebase onto same changeset:
282
282
283 $ hg rebase -b 6 -d 6
283 $ hg rebase -b 6 -d 6
284 nothing to rebase - eea13746799a is both "base" and destination
284 nothing to rebase - eea13746799a is both "base" and destination
285 [1]
285 [1]
286
286
287 G onto F - rebase onto an ancestor:
287 G onto F - rebase onto an ancestor:
288
288
289 $ hg rebase -b 6 -d 5
289 $ hg rebase -b 6 -d 5
290 nothing to rebase
290 nothing to rebase
291 [1]
291 [1]
292
292
293 F onto G - rebase onto a descendant:
293 F onto G - rebase onto a descendant:
294
294
295 $ hg rebase -b 5 -d 6
295 $ hg rebase -b 5 -d 6
296 nothing to rebase - "base" 24b6387c8c8c is already an ancestor of destination eea13746799a
296 nothing to rebase - "base" 24b6387c8c8c is already an ancestor of destination eea13746799a
297 [1]
297 [1]
298
298
299 C onto A - rebase onto an ancestor:
299 C onto A - rebase onto an ancestor:
300
300
301 $ hg rebase -d 0 -s 2
301 $ hg rebase -d 0 -s 2
302 rebasing 2:5fddd98957c8 "C"
302 rebasing 2:5fddd98957c8 "C"
303 rebasing 3:32af7686d403 "D"
303 rebasing 3:32af7686d403 "D"
304 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/5fddd98957c8-f9244fa1-rebase.hg (glob)
304 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/5fddd98957c8-f9244fa1-rebase.hg (glob)
305 $ hg tglog
305 $ hg tglog
306 o 7: 'D'
306 o 7: 'D'
307 |
307 |
308 o 6: 'C'
308 o 6: 'C'
309 |
309 |
310 | @ 5: 'H'
310 | @ 5: 'H'
311 | |
311 | |
312 | | o 4: 'G'
312 | | o 4: 'G'
313 | |/|
313 | |/|
314 | o | 3: 'F'
314 | o | 3: 'F'
315 |/ /
315 |/ /
316 | o 2: 'E'
316 | o 2: 'E'
317 |/
317 |/
318 | o 1: 'B'
318 | o 1: 'B'
319 |/
319 |/
320 o 0: 'A'
320 o 0: 'A'
321
321
322
322
323 Check rebasing public changeset
323 Check rebasing public changeset
324
324
325 $ hg pull --config phases.publish=True -q -r 6 . # update phase of 6
325 $ hg pull --config phases.publish=True -q -r 6 . # update phase of 6
326 $ hg rebase -d 0 -b 6
326 $ hg rebase -d 0 -b 6
327 nothing to rebase
327 nothing to rebase
328 [1]
328 [1]
329 $ hg rebase -d 5 -b 6
329 $ hg rebase -d 5 -b 6
330 abort: can't rebase public changeset e1c4361dd923
330 abort: can't rebase public changeset e1c4361dd923
331 (see 'hg help phases' for details)
331 (see 'hg help phases' for details)
332 [255]
332 [255]
333 $ hg rebase -d 5 -r '1 + (6::)'
333 $ hg rebase -d 5 -r '1 + (6::)'
334 abort: can't rebase public changeset e1c4361dd923
334 abort: can't rebase public changeset e1c4361dd923
335 (see 'hg help phases' for details)
335 (see 'hg help phases' for details)
336 [255]
336 [255]
337
337
338 $ hg rebase -d 5 -b 6 --keep
338 $ hg rebase -d 5 -b 6 --keep
339 rebasing 6:e1c4361dd923 "C"
339 rebasing 6:e1c4361dd923 "C"
340 rebasing 7:c9659aac0000 "D" (tip)
340 rebasing 7:c9659aac0000 "D" (tip)
341
341
342 Check rebasing mutable changeset
342 Check rebasing mutable changeset
343 Source phase greater or equal to destination phase: new changeset get the phase of source:
343 Source phase greater or equal to destination phase: new changeset get the phase of source:
344 $ hg id -n
344 $ hg id -n
345 5
345 5
346 $ hg rebase -s9 -d0
346 $ hg rebase -s9 -d0
347 rebasing 9:2b23e52411f4 "D" (tip)
347 rebasing 9:2b23e52411f4 "D" (tip)
348 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/2b23e52411f4-f942decf-rebase.hg (glob)
348 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/2b23e52411f4-f942decf-rebase.hg (glob)
349 $ hg id -n # check we updated back to parent
349 $ hg id -n # check we updated back to parent
350 5
350 5
351 $ hg log --template "{phase}\n" -r 9
351 $ hg log --template "{phase}\n" -r 9
352 draft
352 draft
353 $ hg rebase -s9 -d1
353 $ hg rebase -s9 -d1
354 rebasing 9:2cb10d0cfc6c "D" (tip)
354 rebasing 9:2cb10d0cfc6c "D" (tip)
355 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/2cb10d0cfc6c-ddb0f256-rebase.hg (glob)
355 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/2cb10d0cfc6c-ddb0f256-rebase.hg (glob)
356 $ hg log --template "{phase}\n" -r 9
356 $ hg log --template "{phase}\n" -r 9
357 draft
357 draft
358 $ hg phase --force --secret 9
358 $ hg phase --force --secret 9
359 $ hg rebase -s9 -d0
359 $ hg rebase -s9 -d0
360 rebasing 9:c5b12b67163a "D" (tip)
360 rebasing 9:c5b12b67163a "D" (tip)
361 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/c5b12b67163a-4e372053-rebase.hg (glob)
361 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/c5b12b67163a-4e372053-rebase.hg (glob)
362 $ hg log --template "{phase}\n" -r 9
362 $ hg log --template "{phase}\n" -r 9
363 secret
363 secret
364 $ hg rebase -s9 -d1
364 $ hg rebase -s9 -d1
365 rebasing 9:2a0524f868ac "D" (tip)
365 rebasing 9:2a0524f868ac "D" (tip)
366 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/2a0524f868ac-cefd8574-rebase.hg (glob)
366 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/2a0524f868ac-cefd8574-rebase.hg (glob)
367 $ hg log --template "{phase}\n" -r 9
367 $ hg log --template "{phase}\n" -r 9
368 secret
368 secret
369 Source phase lower than destination phase: new changeset get the phase of destination:
369 Source phase lower than destination phase: new changeset get the phase of destination:
370 $ hg rebase -s8 -d9
370 $ hg rebase -s8 -d9
371 rebasing 8:6d4f22462821 "C"
371 rebasing 8:6d4f22462821 "C"
372 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/6d4f22462821-3441f70b-rebase.hg (glob)
372 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/6d4f22462821-3441f70b-rebase.hg (glob)
373 $ hg log --template "{phase}\n" -r 'rev(9)'
373 $ hg log --template "{phase}\n" -r 'rev(9)'
374 secret
374 secret
375
375
376 $ cd ..
376 $ cd ..
377
377
378 Check that temporary bundle doesn't lose phase when not using generaldelta
379
380 $ hg --config format.usegeneraldelta=no init issue5678
381 $ cd issue5678
382 $ grep generaldelta .hg/requires
383 [1]
384 $ echo a > a
385 $ hg ci -Aqm a
386 $ echo b > b
387 $ hg ci -Aqm b
388 $ hg co -q '.^'
389 $ echo c > c
390 $ hg ci -Aqm c
391 $ hg phase --public
392 $ hg log -G -T '{rev}:{node|shortest} {phase} {desc}\n'
393 @ 2:d36c public c
394 |
395 | o 1:d2ae draft b
396 |/
397 o 0:cb9a public a
398
399 $ hg rebase -s 1 -d 2
400 rebasing 1:d2ae7f538514 "b"
401 saved backup bundle to $TESTTMP/issue5678/.hg/strip-backup/d2ae7f538514-2953539b-rebase.hg (glob)
402 BROKEN: d36c should remain public
403 $ hg log -G -T '{rev}:{node|shortest} {phase} {desc}\n'
404 o 2:c882 draft b
405 |
406 @ 1:d36c draft c
407 |
408 o 0:cb9a public a
409
410 $ cd ..
411
378 Test for revset
412 Test for revset
379
413
380 We need a bit different graph
414 We need a bit different graph
381 All destination are B
415 All destination are B
382
416
383 $ hg init ah
417 $ hg init ah
384 $ cd ah
418 $ cd ah
385 $ hg unbundle "$TESTDIR/bundles/rebase-revset.hg"
419 $ hg unbundle "$TESTDIR/bundles/rebase-revset.hg"
386 adding changesets
420 adding changesets
387 adding manifests
421 adding manifests
388 adding file changes
422 adding file changes
389 added 9 changesets with 9 changes to 9 files (+2 heads)
423 added 9 changesets with 9 changes to 9 files (+2 heads)
390 (run 'hg heads' to see heads, 'hg merge' to merge)
424 (run 'hg heads' to see heads, 'hg merge' to merge)
391 $ hg tglog
425 $ hg tglog
392 o 8: 'I'
426 o 8: 'I'
393 |
427 |
394 o 7: 'H'
428 o 7: 'H'
395 |
429 |
396 o 6: 'G'
430 o 6: 'G'
397 |
431 |
398 | o 5: 'F'
432 | o 5: 'F'
399 | |
433 | |
400 | o 4: 'E'
434 | o 4: 'E'
401 |/
435 |/
402 o 3: 'D'
436 o 3: 'D'
403 |
437 |
404 o 2: 'C'
438 o 2: 'C'
405 |
439 |
406 | o 1: 'B'
440 | o 1: 'B'
407 |/
441 |/
408 o 0: 'A'
442 o 0: 'A'
409
443
410 $ cd ..
444 $ cd ..
411
445
412
446
413 Simple case with keep:
447 Simple case with keep:
414
448
415 Source on have two descendant heads but ask for one
449 Source on have two descendant heads but ask for one
416
450
417 $ hg clone -q -u . ah ah1
451 $ hg clone -q -u . ah ah1
418 $ cd ah1
452 $ cd ah1
419 $ hg rebase -r '2::8' -d 1
453 $ hg rebase -r '2::8' -d 1
420 abort: can't remove original changesets with unrebased descendants
454 abort: can't remove original changesets with unrebased descendants
421 (use --keep to keep original changesets)
455 (use --keep to keep original changesets)
422 [255]
456 [255]
423 $ hg rebase -r '2::8' -d 1 -k
457 $ hg rebase -r '2::8' -d 1 -k
424 rebasing 2:c9e50f6cdc55 "C"
458 rebasing 2:c9e50f6cdc55 "C"
425 rebasing 3:ffd453c31098 "D"
459 rebasing 3:ffd453c31098 "D"
426 rebasing 6:3d8a618087a7 "G"
460 rebasing 6:3d8a618087a7 "G"
427 rebasing 7:72434a4e60b0 "H"
461 rebasing 7:72434a4e60b0 "H"
428 rebasing 8:479ddb54a924 "I" (tip)
462 rebasing 8:479ddb54a924 "I" (tip)
429 $ hg tglog
463 $ hg tglog
430 o 13: 'I'
464 o 13: 'I'
431 |
465 |
432 o 12: 'H'
466 o 12: 'H'
433 |
467 |
434 o 11: 'G'
468 o 11: 'G'
435 |
469 |
436 o 10: 'D'
470 o 10: 'D'
437 |
471 |
438 o 9: 'C'
472 o 9: 'C'
439 |
473 |
440 | o 8: 'I'
474 | o 8: 'I'
441 | |
475 | |
442 | o 7: 'H'
476 | o 7: 'H'
443 | |
477 | |
444 | o 6: 'G'
478 | o 6: 'G'
445 | |
479 | |
446 | | o 5: 'F'
480 | | o 5: 'F'
447 | | |
481 | | |
448 | | o 4: 'E'
482 | | o 4: 'E'
449 | |/
483 | |/
450 | o 3: 'D'
484 | o 3: 'D'
451 | |
485 | |
452 | o 2: 'C'
486 | o 2: 'C'
453 | |
487 | |
454 o | 1: 'B'
488 o | 1: 'B'
455 |/
489 |/
456 o 0: 'A'
490 o 0: 'A'
457
491
458
492
459 $ cd ..
493 $ cd ..
460
494
461 Base on have one descendant heads we ask for but common ancestor have two
495 Base on have one descendant heads we ask for but common ancestor have two
462
496
463 $ hg clone -q -u . ah ah2
497 $ hg clone -q -u . ah ah2
464 $ cd ah2
498 $ cd ah2
465 $ hg rebase -r '3::8' -d 1
499 $ hg rebase -r '3::8' -d 1
466 abort: can't remove original changesets with unrebased descendants
500 abort: can't remove original changesets with unrebased descendants
467 (use --keep to keep original changesets)
501 (use --keep to keep original changesets)
468 [255]
502 [255]
469 $ hg rebase -r '3::8' -d 1 --keep
503 $ hg rebase -r '3::8' -d 1 --keep
470 rebasing 3:ffd453c31098 "D"
504 rebasing 3:ffd453c31098 "D"
471 rebasing 6:3d8a618087a7 "G"
505 rebasing 6:3d8a618087a7 "G"
472 rebasing 7:72434a4e60b0 "H"
506 rebasing 7:72434a4e60b0 "H"
473 rebasing 8:479ddb54a924 "I" (tip)
507 rebasing 8:479ddb54a924 "I" (tip)
474 $ hg tglog
508 $ hg tglog
475 o 12: 'I'
509 o 12: 'I'
476 |
510 |
477 o 11: 'H'
511 o 11: 'H'
478 |
512 |
479 o 10: 'G'
513 o 10: 'G'
480 |
514 |
481 o 9: 'D'
515 o 9: 'D'
482 |
516 |
483 | o 8: 'I'
517 | o 8: 'I'
484 | |
518 | |
485 | o 7: 'H'
519 | o 7: 'H'
486 | |
520 | |
487 | o 6: 'G'
521 | o 6: 'G'
488 | |
522 | |
489 | | o 5: 'F'
523 | | o 5: 'F'
490 | | |
524 | | |
491 | | o 4: 'E'
525 | | o 4: 'E'
492 | |/
526 | |/
493 | o 3: 'D'
527 | o 3: 'D'
494 | |
528 | |
495 | o 2: 'C'
529 | o 2: 'C'
496 | |
530 | |
497 o | 1: 'B'
531 o | 1: 'B'
498 |/
532 |/
499 o 0: 'A'
533 o 0: 'A'
500
534
501
535
502 $ cd ..
536 $ cd ..
503
537
504 rebase subset
538 rebase subset
505
539
506 $ hg clone -q -u . ah ah3
540 $ hg clone -q -u . ah ah3
507 $ cd ah3
541 $ cd ah3
508 $ hg rebase -r '3::7' -d 1
542 $ hg rebase -r '3::7' -d 1
509 abort: can't remove original changesets with unrebased descendants
543 abort: can't remove original changesets with unrebased descendants
510 (use --keep to keep original changesets)
544 (use --keep to keep original changesets)
511 [255]
545 [255]
512 $ hg rebase -r '3::7' -d 1 --keep
546 $ hg rebase -r '3::7' -d 1 --keep
513 rebasing 3:ffd453c31098 "D"
547 rebasing 3:ffd453c31098 "D"
514 rebasing 6:3d8a618087a7 "G"
548 rebasing 6:3d8a618087a7 "G"
515 rebasing 7:72434a4e60b0 "H"
549 rebasing 7:72434a4e60b0 "H"
516 $ hg tglog
550 $ hg tglog
517 o 11: 'H'
551 o 11: 'H'
518 |
552 |
519 o 10: 'G'
553 o 10: 'G'
520 |
554 |
521 o 9: 'D'
555 o 9: 'D'
522 |
556 |
523 | o 8: 'I'
557 | o 8: 'I'
524 | |
558 | |
525 | o 7: 'H'
559 | o 7: 'H'
526 | |
560 | |
527 | o 6: 'G'
561 | o 6: 'G'
528 | |
562 | |
529 | | o 5: 'F'
563 | | o 5: 'F'
530 | | |
564 | | |
531 | | o 4: 'E'
565 | | o 4: 'E'
532 | |/
566 | |/
533 | o 3: 'D'
567 | o 3: 'D'
534 | |
568 | |
535 | o 2: 'C'
569 | o 2: 'C'
536 | |
570 | |
537 o | 1: 'B'
571 o | 1: 'B'
538 |/
572 |/
539 o 0: 'A'
573 o 0: 'A'
540
574
541
575
542 $ cd ..
576 $ cd ..
543
577
544 rebase subset with multiple head
578 rebase subset with multiple head
545
579
546 $ hg clone -q -u . ah ah4
580 $ hg clone -q -u . ah ah4
547 $ cd ah4
581 $ cd ah4
548 $ hg rebase -r '3::(7+5)' -d 1
582 $ hg rebase -r '3::(7+5)' -d 1
549 abort: can't remove original changesets with unrebased descendants
583 abort: can't remove original changesets with unrebased descendants
550 (use --keep to keep original changesets)
584 (use --keep to keep original changesets)
551 [255]
585 [255]
552 $ hg rebase -r '3::(7+5)' -d 1 --keep
586 $ hg rebase -r '3::(7+5)' -d 1 --keep
553 rebasing 3:ffd453c31098 "D"
587 rebasing 3:ffd453c31098 "D"
554 rebasing 4:c01897464e7f "E"
588 rebasing 4:c01897464e7f "E"
555 rebasing 5:41bfcc75ed73 "F"
589 rebasing 5:41bfcc75ed73 "F"
556 rebasing 6:3d8a618087a7 "G"
590 rebasing 6:3d8a618087a7 "G"
557 rebasing 7:72434a4e60b0 "H"
591 rebasing 7:72434a4e60b0 "H"
558 $ hg tglog
592 $ hg tglog
559 o 13: 'H'
593 o 13: 'H'
560 |
594 |
561 o 12: 'G'
595 o 12: 'G'
562 |
596 |
563 | o 11: 'F'
597 | o 11: 'F'
564 | |
598 | |
565 | o 10: 'E'
599 | o 10: 'E'
566 |/
600 |/
567 o 9: 'D'
601 o 9: 'D'
568 |
602 |
569 | o 8: 'I'
603 | o 8: 'I'
570 | |
604 | |
571 | o 7: 'H'
605 | o 7: 'H'
572 | |
606 | |
573 | o 6: 'G'
607 | o 6: 'G'
574 | |
608 | |
575 | | o 5: 'F'
609 | | o 5: 'F'
576 | | |
610 | | |
577 | | o 4: 'E'
611 | | o 4: 'E'
578 | |/
612 | |/
579 | o 3: 'D'
613 | o 3: 'D'
580 | |
614 | |
581 | o 2: 'C'
615 | o 2: 'C'
582 | |
616 | |
583 o | 1: 'B'
617 o | 1: 'B'
584 |/
618 |/
585 o 0: 'A'
619 o 0: 'A'
586
620
587
621
588 $ cd ..
622 $ cd ..
589
623
590 More advanced tests
624 More advanced tests
591
625
592 rebase on ancestor with revset
626 rebase on ancestor with revset
593
627
594 $ hg clone -q -u . ah ah5
628 $ hg clone -q -u . ah ah5
595 $ cd ah5
629 $ cd ah5
596 $ hg rebase -r '6::' -d 2
630 $ hg rebase -r '6::' -d 2
597 rebasing 6:3d8a618087a7 "G"
631 rebasing 6:3d8a618087a7 "G"
598 rebasing 7:72434a4e60b0 "H"
632 rebasing 7:72434a4e60b0 "H"
599 rebasing 8:479ddb54a924 "I" (tip)
633 rebasing 8:479ddb54a924 "I" (tip)
600 saved backup bundle to $TESTTMP/ah5/.hg/strip-backup/3d8a618087a7-b4f73f31-rebase.hg (glob)
634 saved backup bundle to $TESTTMP/ah5/.hg/strip-backup/3d8a618087a7-b4f73f31-rebase.hg (glob)
601 $ hg tglog
635 $ hg tglog
602 o 8: 'I'
636 o 8: 'I'
603 |
637 |
604 o 7: 'H'
638 o 7: 'H'
605 |
639 |
606 o 6: 'G'
640 o 6: 'G'
607 |
641 |
608 | o 5: 'F'
642 | o 5: 'F'
609 | |
643 | |
610 | o 4: 'E'
644 | o 4: 'E'
611 | |
645 | |
612 | o 3: 'D'
646 | o 3: 'D'
613 |/
647 |/
614 o 2: 'C'
648 o 2: 'C'
615 |
649 |
616 | o 1: 'B'
650 | o 1: 'B'
617 |/
651 |/
618 o 0: 'A'
652 o 0: 'A'
619
653
620 $ cd ..
654 $ cd ..
621
655
622
656
623 rebase with multiple root.
657 rebase with multiple root.
624 We rebase E and G on B
658 We rebase E and G on B
625 We would expect heads are I, F if it was supported
659 We would expect heads are I, F if it was supported
626
660
627 $ hg clone -q -u . ah ah6
661 $ hg clone -q -u . ah ah6
628 $ cd ah6
662 $ cd ah6
629 $ hg rebase -r '(4+6)::' -d 1
663 $ hg rebase -r '(4+6)::' -d 1
630 rebasing 4:c01897464e7f "E"
664 rebasing 4:c01897464e7f "E"
631 rebasing 5:41bfcc75ed73 "F"
665 rebasing 5:41bfcc75ed73 "F"
632 rebasing 6:3d8a618087a7 "G"
666 rebasing 6:3d8a618087a7 "G"
633 rebasing 7:72434a4e60b0 "H"
667 rebasing 7:72434a4e60b0 "H"
634 rebasing 8:479ddb54a924 "I" (tip)
668 rebasing 8:479ddb54a924 "I" (tip)
635 saved backup bundle to $TESTTMP/ah6/.hg/strip-backup/3d8a618087a7-aae93a24-rebase.hg (glob)
669 saved backup bundle to $TESTTMP/ah6/.hg/strip-backup/3d8a618087a7-aae93a24-rebase.hg (glob)
636 $ hg tglog
670 $ hg tglog
637 o 8: 'I'
671 o 8: 'I'
638 |
672 |
639 o 7: 'H'
673 o 7: 'H'
640 |
674 |
641 o 6: 'G'
675 o 6: 'G'
642 |
676 |
643 | o 5: 'F'
677 | o 5: 'F'
644 | |
678 | |
645 | o 4: 'E'
679 | o 4: 'E'
646 |/
680 |/
647 | o 3: 'D'
681 | o 3: 'D'
648 | |
682 | |
649 | o 2: 'C'
683 | o 2: 'C'
650 | |
684 | |
651 o | 1: 'B'
685 o | 1: 'B'
652 |/
686 |/
653 o 0: 'A'
687 o 0: 'A'
654
688
655 $ cd ..
689 $ cd ..
656
690
657 More complex rebase with multiple roots
691 More complex rebase with multiple roots
658 each root have a different common ancestor with the destination and this is a detach
692 each root have a different common ancestor with the destination and this is a detach
659
693
660 (setup)
694 (setup)
661
695
662 $ hg clone -q -u . a a8
696 $ hg clone -q -u . a a8
663 $ cd a8
697 $ cd a8
664 $ echo I > I
698 $ echo I > I
665 $ hg add I
699 $ hg add I
666 $ hg commit -m I
700 $ hg commit -m I
667 $ hg up 4
701 $ hg up 4
668 1 files updated, 0 files merged, 3 files removed, 0 files unresolved
702 1 files updated, 0 files merged, 3 files removed, 0 files unresolved
669 $ echo I > J
703 $ echo I > J
670 $ hg add J
704 $ hg add J
671 $ hg commit -m J
705 $ hg commit -m J
672 created new head
706 created new head
673 $ echo I > K
707 $ echo I > K
674 $ hg add K
708 $ hg add K
675 $ hg commit -m K
709 $ hg commit -m K
676 $ hg tglog
710 $ hg tglog
677 @ 10: 'K'
711 @ 10: 'K'
678 |
712 |
679 o 9: 'J'
713 o 9: 'J'
680 |
714 |
681 | o 8: 'I'
715 | o 8: 'I'
682 | |
716 | |
683 | o 7: 'H'
717 | o 7: 'H'
684 | |
718 | |
685 +---o 6: 'G'
719 +---o 6: 'G'
686 | |/
720 | |/
687 | o 5: 'F'
721 | o 5: 'F'
688 | |
722 | |
689 o | 4: 'E'
723 o | 4: 'E'
690 |/
724 |/
691 | o 3: 'D'
725 | o 3: 'D'
692 | |
726 | |
693 | o 2: 'C'
727 | o 2: 'C'
694 | |
728 | |
695 | o 1: 'B'
729 | o 1: 'B'
696 |/
730 |/
697 o 0: 'A'
731 o 0: 'A'
698
732
699 (actual test)
733 (actual test)
700
734
701 $ hg rebase --dest 'desc(G)' --rev 'desc(K) + desc(I)'
735 $ hg rebase --dest 'desc(G)' --rev 'desc(K) + desc(I)'
702 rebasing 8:e7ec4e813ba6 "I"
736 rebasing 8:e7ec4e813ba6 "I"
703 rebasing 10:23a4ace37988 "K" (tip)
737 rebasing 10:23a4ace37988 "K" (tip)
704 saved backup bundle to $TESTTMP/a8/.hg/strip-backup/23a4ace37988-b06984b3-rebase.hg (glob)
738 saved backup bundle to $TESTTMP/a8/.hg/strip-backup/23a4ace37988-b06984b3-rebase.hg (glob)
705 $ hg log --rev 'children(desc(G))'
739 $ hg log --rev 'children(desc(G))'
706 changeset: 9:adb617877056
740 changeset: 9:adb617877056
707 parent: 6:eea13746799a
741 parent: 6:eea13746799a
708 user: test
742 user: test
709 date: Thu Jan 01 00:00:00 1970 +0000
743 date: Thu Jan 01 00:00:00 1970 +0000
710 summary: I
744 summary: I
711
745
712 changeset: 10:882431a34a0e
746 changeset: 10:882431a34a0e
713 tag: tip
747 tag: tip
714 parent: 6:eea13746799a
748 parent: 6:eea13746799a
715 user: test
749 user: test
716 date: Thu Jan 01 00:00:00 1970 +0000
750 date: Thu Jan 01 00:00:00 1970 +0000
717 summary: K
751 summary: K
718
752
719 $ hg tglog
753 $ hg tglog
720 @ 10: 'K'
754 @ 10: 'K'
721 |
755 |
722 | o 9: 'I'
756 | o 9: 'I'
723 |/
757 |/
724 | o 8: 'J'
758 | o 8: 'J'
725 | |
759 | |
726 | | o 7: 'H'
760 | | o 7: 'H'
727 | | |
761 | | |
728 o---+ 6: 'G'
762 o---+ 6: 'G'
729 |/ /
763 |/ /
730 | o 5: 'F'
764 | o 5: 'F'
731 | |
765 | |
732 o | 4: 'E'
766 o | 4: 'E'
733 |/
767 |/
734 | o 3: 'D'
768 | o 3: 'D'
735 | |
769 | |
736 | o 2: 'C'
770 | o 2: 'C'
737 | |
771 | |
738 | o 1: 'B'
772 | o 1: 'B'
739 |/
773 |/
740 o 0: 'A'
774 o 0: 'A'
741
775
742
776
743 Test that rebase is not confused by $CWD disappearing during rebase (issue4121)
777 Test that rebase is not confused by $CWD disappearing during rebase (issue4121)
744
778
745 $ cd ..
779 $ cd ..
746 $ hg init cwd-vanish
780 $ hg init cwd-vanish
747 $ cd cwd-vanish
781 $ cd cwd-vanish
748 $ touch initial-file
782 $ touch initial-file
749 $ hg add initial-file
783 $ hg add initial-file
750 $ hg commit -m 'initial commit'
784 $ hg commit -m 'initial commit'
751 $ touch dest-file
785 $ touch dest-file
752 $ hg add dest-file
786 $ hg add dest-file
753 $ hg commit -m 'dest commit'
787 $ hg commit -m 'dest commit'
754 $ hg up 0
788 $ hg up 0
755 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
789 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
756 $ touch other-file
790 $ touch other-file
757 $ hg add other-file
791 $ hg add other-file
758 $ hg commit -m 'first source commit'
792 $ hg commit -m 'first source commit'
759 created new head
793 created new head
760 $ mkdir subdir
794 $ mkdir subdir
761 $ cd subdir
795 $ cd subdir
762 $ touch subfile
796 $ touch subfile
763 $ hg add subfile
797 $ hg add subfile
764 $ hg commit -m 'second source with subdir'
798 $ hg commit -m 'second source with subdir'
765
799
766 $ hg rebase -b . -d 1 --traceback
800 $ hg rebase -b . -d 1 --traceback
767 rebasing 2:779a07b1b7a0 "first source commit"
801 rebasing 2:779a07b1b7a0 "first source commit"
768 current directory was removed (rmcwd !)
802 current directory was removed (rmcwd !)
769 (consider changing to repo root: $TESTTMP/cwd-vanish) (rmcwd !)
803 (consider changing to repo root: $TESTTMP/cwd-vanish) (rmcwd !)
770 rebasing 3:a7d6f3a00bf3 "second source with subdir" (tip)
804 rebasing 3:a7d6f3a00bf3 "second source with subdir" (tip)
771 saved backup bundle to $TESTTMP/cwd-vanish/.hg/strip-backup/779a07b1b7a0-853e0073-rebase.hg (glob)
805 saved backup bundle to $TESTTMP/cwd-vanish/.hg/strip-backup/779a07b1b7a0-853e0073-rebase.hg (glob)
772
806
773 Get back to the root of cwd-vanish. Note that even though `cd ..`
807 Get back to the root of cwd-vanish. Note that even though `cd ..`
774 works on most systems, it does not work on FreeBSD 10, so we use an
808 works on most systems, it does not work on FreeBSD 10, so we use an
775 absolute path to get back to the repository.
809 absolute path to get back to the repository.
776 $ cd $TESTTMP
810 $ cd $TESTTMP
777
811
778 Test that rebase is done in topo order (issue5370)
812 Test that rebase is done in topo order (issue5370)
779
813
780 $ hg init order
814 $ hg init order
781 $ cd order
815 $ cd order
782 $ touch a && hg add a && hg ci -m A
816 $ touch a && hg add a && hg ci -m A
783 $ touch b && hg add b && hg ci -m B
817 $ touch b && hg add b && hg ci -m B
784 $ touch c && hg add c && hg ci -m C
818 $ touch c && hg add c && hg ci -m C
785 $ hg up 1
819 $ hg up 1
786 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
820 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
787 $ touch d && hg add d && hg ci -m D
821 $ touch d && hg add d && hg ci -m D
788 created new head
822 created new head
789 $ hg up 2
823 $ hg up 2
790 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
824 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
791 $ touch e && hg add e && hg ci -m E
825 $ touch e && hg add e && hg ci -m E
792 $ hg up 3
826 $ hg up 3
793 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
827 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
794 $ touch f && hg add f && hg ci -m F
828 $ touch f && hg add f && hg ci -m F
795 $ hg up 0
829 $ hg up 0
796 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
830 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
797 $ touch g && hg add g && hg ci -m G
831 $ touch g && hg add g && hg ci -m G
798 created new head
832 created new head
799
833
800 $ hg tglog
834 $ hg tglog
801 @ 6: 'G'
835 @ 6: 'G'
802 |
836 |
803 | o 5: 'F'
837 | o 5: 'F'
804 | |
838 | |
805 | | o 4: 'E'
839 | | o 4: 'E'
806 | | |
840 | | |
807 | o | 3: 'D'
841 | o | 3: 'D'
808 | | |
842 | | |
809 | | o 2: 'C'
843 | | o 2: 'C'
810 | |/
844 | |/
811 | o 1: 'B'
845 | o 1: 'B'
812 |/
846 |/
813 o 0: 'A'
847 o 0: 'A'
814
848
815
849
816 $ hg rebase -s 1 -d 6
850 $ hg rebase -s 1 -d 6
817 rebasing 1:76035bbd54bd "B"
851 rebasing 1:76035bbd54bd "B"
818 rebasing 2:d84f5cfaaf14 "C"
852 rebasing 2:d84f5cfaaf14 "C"
819 rebasing 4:82ae8dc7a9b7 "E"
853 rebasing 4:82ae8dc7a9b7 "E"
820 rebasing 3:ab709c9f7171 "D"
854 rebasing 3:ab709c9f7171 "D"
821 rebasing 5:412b391de760 "F"
855 rebasing 5:412b391de760 "F"
822 saved backup bundle to $TESTTMP/order/.hg/strip-backup/76035bbd54bd-e341bc99-rebase.hg (glob)
856 saved backup bundle to $TESTTMP/order/.hg/strip-backup/76035bbd54bd-e341bc99-rebase.hg (glob)
823
857
824 $ hg tglog
858 $ hg tglog
825 o 6: 'F'
859 o 6: 'F'
826 |
860 |
827 o 5: 'D'
861 o 5: 'D'
828 |
862 |
829 | o 4: 'E'
863 | o 4: 'E'
830 | |
864 | |
831 | o 3: 'C'
865 | o 3: 'C'
832 |/
866 |/
833 o 2: 'B'
867 o 2: 'B'
834 |
868 |
835 @ 1: 'G'
869 @ 1: 'G'
836 |
870 |
837 o 0: 'A'
871 o 0: 'A'
838
872
839
873
840 Test experimental revset
874 Test experimental revset
841 ========================
875 ========================
842
876
843 $ cd ../cwd-vanish
877 $ cd ../cwd-vanish
844
878
845 Make the repo a bit more interesting
879 Make the repo a bit more interesting
846
880
847 $ hg up 1
881 $ hg up 1
848 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
882 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
849 $ echo aaa > aaa
883 $ echo aaa > aaa
850 $ hg add aaa
884 $ hg add aaa
851 $ hg commit -m aaa
885 $ hg commit -m aaa
852 created new head
886 created new head
853 $ hg log -G
887 $ hg log -G
854 @ changeset: 4:5f7bc9025ed2
888 @ changeset: 4:5f7bc9025ed2
855 | tag: tip
889 | tag: tip
856 | parent: 1:58d79cc1cf43
890 | parent: 1:58d79cc1cf43
857 | user: test
891 | user: test
858 | date: Thu Jan 01 00:00:00 1970 +0000
892 | date: Thu Jan 01 00:00:00 1970 +0000
859 | summary: aaa
893 | summary: aaa
860 |
894 |
861 | o changeset: 3:1910d5ff34ea
895 | o changeset: 3:1910d5ff34ea
862 | | user: test
896 | | user: test
863 | | date: Thu Jan 01 00:00:00 1970 +0000
897 | | date: Thu Jan 01 00:00:00 1970 +0000
864 | | summary: second source with subdir
898 | | summary: second source with subdir
865 | |
899 | |
866 | o changeset: 2:82901330b6ef
900 | o changeset: 2:82901330b6ef
867 |/ user: test
901 |/ user: test
868 | date: Thu Jan 01 00:00:00 1970 +0000
902 | date: Thu Jan 01 00:00:00 1970 +0000
869 | summary: first source commit
903 | summary: first source commit
870 |
904 |
871 o changeset: 1:58d79cc1cf43
905 o changeset: 1:58d79cc1cf43
872 | user: test
906 | user: test
873 | date: Thu Jan 01 00:00:00 1970 +0000
907 | date: Thu Jan 01 00:00:00 1970 +0000
874 | summary: dest commit
908 | summary: dest commit
875 |
909 |
876 o changeset: 0:e94b687f7da3
910 o changeset: 0:e94b687f7da3
877 user: test
911 user: test
878 date: Thu Jan 01 00:00:00 1970 +0000
912 date: Thu Jan 01 00:00:00 1970 +0000
879 summary: initial commit
913 summary: initial commit
880
914
881
915
882 Testing from lower head
916 Testing from lower head
883
917
884 $ hg up 3
918 $ hg up 3
885 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
919 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
886 $ hg log -r '_destrebase()'
920 $ hg log -r '_destrebase()'
887 changeset: 4:5f7bc9025ed2
921 changeset: 4:5f7bc9025ed2
888 tag: tip
922 tag: tip
889 parent: 1:58d79cc1cf43
923 parent: 1:58d79cc1cf43
890 user: test
924 user: test
891 date: Thu Jan 01 00:00:00 1970 +0000
925 date: Thu Jan 01 00:00:00 1970 +0000
892 summary: aaa
926 summary: aaa
893
927
894
928
895 Testing from upper head
929 Testing from upper head
896
930
897 $ hg log -r '_destrebase(4)'
931 $ hg log -r '_destrebase(4)'
898 changeset: 3:1910d5ff34ea
932 changeset: 3:1910d5ff34ea
899 user: test
933 user: test
900 date: Thu Jan 01 00:00:00 1970 +0000
934 date: Thu Jan 01 00:00:00 1970 +0000
901 summary: second source with subdir
935 summary: second source with subdir
902
936
903 $ hg up 4
937 $ hg up 4
904 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
938 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
905 $ hg log -r '_destrebase()'
939 $ hg log -r '_destrebase()'
906 changeset: 3:1910d5ff34ea
940 changeset: 3:1910d5ff34ea
907 user: test
941 user: test
908 date: Thu Jan 01 00:00:00 1970 +0000
942 date: Thu Jan 01 00:00:00 1970 +0000
909 summary: second source with subdir
943 summary: second source with subdir
910
944
911 Testing rebase being called inside another transaction
945 Testing rebase being called inside another transaction
912
946
913 $ cd $TESTTMP
947 $ cd $TESTTMP
914 $ hg init tr-state
948 $ hg init tr-state
915 $ cd tr-state
949 $ cd tr-state
916 $ cat > $TESTTMP/wraprebase.py <<EOF
950 $ cat > $TESTTMP/wraprebase.py <<EOF
917 > from __future__ import absolute_import
951 > from __future__ import absolute_import
918 > from mercurial import extensions
952 > from mercurial import extensions
919 > def _rebase(orig, ui, repo, *args, **kwargs):
953 > def _rebase(orig, ui, repo, *args, **kwargs):
920 > with repo.wlock():
954 > with repo.wlock():
921 > with repo.lock():
955 > with repo.lock():
922 > with repo.transaction('wrappedrebase'):
956 > with repo.transaction('wrappedrebase'):
923 > return orig(ui, repo, *args, **kwargs)
957 > return orig(ui, repo, *args, **kwargs)
924 > def wraprebase(loaded):
958 > def wraprebase(loaded):
925 > assert loaded
959 > assert loaded
926 > rebasemod = extensions.find('rebase')
960 > rebasemod = extensions.find('rebase')
927 > extensions.wrapcommand(rebasemod.cmdtable, 'rebase', _rebase)
961 > extensions.wrapcommand(rebasemod.cmdtable, 'rebase', _rebase)
928 > def extsetup(ui):
962 > def extsetup(ui):
929 > extensions.afterloaded('rebase', wraprebase)
963 > extensions.afterloaded('rebase', wraprebase)
930 > EOF
964 > EOF
931
965
932 $ cat >> .hg/hgrc <<EOF
966 $ cat >> .hg/hgrc <<EOF
933 > [extensions]
967 > [extensions]
934 > wraprebase=$TESTTMP/wraprebase.py
968 > wraprebase=$TESTTMP/wraprebase.py
935 > [experimental]
969 > [experimental]
936 > evolution=all
970 > evolution=all
937 > EOF
971 > EOF
938
972
939 $ hg debugdrawdag <<'EOS'
973 $ hg debugdrawdag <<'EOS'
940 > B C
974 > B C
941 > |/
975 > |/
942 > A
976 > A
943 > EOS
977 > EOS
944
978
945 $ hg rebase -s C -d B
979 $ hg rebase -s C -d B
946 rebasing 2:dc0947a82db8 "C" (C tip)
980 rebasing 2:dc0947a82db8 "C" (C tip)
947
981
948 $ [ -f .hg/rebasestate ] && echo 'WRONG: rebasestate should not exist'
982 $ [ -f .hg/rebasestate ] && echo 'WRONG: rebasestate should not exist'
949 [1]
983 [1]
@@ -1,1099 +1,1121 b''
1 $ echo "[format]" >> $HGRCPATH
1 $ echo "[format]" >> $HGRCPATH
2 $ echo "usegeneraldelta=yes" >> $HGRCPATH
2 $ echo "usegeneraldelta=yes" >> $HGRCPATH
3 $ echo "[extensions]" >> $HGRCPATH
3 $ echo "[extensions]" >> $HGRCPATH
4 $ echo "strip=" >> $HGRCPATH
4 $ echo "strip=" >> $HGRCPATH
5 $ echo "drawdag=$TESTDIR/drawdag.py" >> $HGRCPATH
5 $ echo "drawdag=$TESTDIR/drawdag.py" >> $HGRCPATH
6
6
7 $ restore() {
7 $ restore() {
8 > hg unbundle -q .hg/strip-backup/*
8 > hg unbundle -q .hg/strip-backup/*
9 > rm .hg/strip-backup/*
9 > rm .hg/strip-backup/*
10 > }
10 > }
11 $ teststrip() {
11 $ teststrip() {
12 > hg up -C $1
12 > hg up -C $1
13 > echo % before update $1, strip $2
13 > echo % before update $1, strip $2
14 > hg parents
14 > hg parents
15 > hg --traceback strip $2
15 > hg --traceback strip $2
16 > echo % after update $1, strip $2
16 > echo % after update $1, strip $2
17 > hg parents
17 > hg parents
18 > restore
18 > restore
19 > }
19 > }
20
20
21 $ hg init test
21 $ hg init test
22 $ cd test
22 $ cd test
23
23
24 $ echo foo > bar
24 $ echo foo > bar
25 $ hg ci -Ama
25 $ hg ci -Ama
26 adding bar
26 adding bar
27
27
28 $ echo more >> bar
28 $ echo more >> bar
29 $ hg ci -Amb
29 $ hg ci -Amb
30
30
31 $ echo blah >> bar
31 $ echo blah >> bar
32 $ hg ci -Amc
32 $ hg ci -Amc
33
33
34 $ hg up 1
34 $ hg up 1
35 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
35 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
36 $ echo blah >> bar
36 $ echo blah >> bar
37 $ hg ci -Amd
37 $ hg ci -Amd
38 created new head
38 created new head
39
39
40 $ echo final >> bar
40 $ echo final >> bar
41 $ hg ci -Ame
41 $ hg ci -Ame
42
42
43 $ hg log
43 $ hg log
44 changeset: 4:443431ffac4f
44 changeset: 4:443431ffac4f
45 tag: tip
45 tag: tip
46 user: test
46 user: test
47 date: Thu Jan 01 00:00:00 1970 +0000
47 date: Thu Jan 01 00:00:00 1970 +0000
48 summary: e
48 summary: e
49
49
50 changeset: 3:65bd5f99a4a3
50 changeset: 3:65bd5f99a4a3
51 parent: 1:ef3a871183d7
51 parent: 1:ef3a871183d7
52 user: test
52 user: test
53 date: Thu Jan 01 00:00:00 1970 +0000
53 date: Thu Jan 01 00:00:00 1970 +0000
54 summary: d
54 summary: d
55
55
56 changeset: 2:264128213d29
56 changeset: 2:264128213d29
57 user: test
57 user: test
58 date: Thu Jan 01 00:00:00 1970 +0000
58 date: Thu Jan 01 00:00:00 1970 +0000
59 summary: c
59 summary: c
60
60
61 changeset: 1:ef3a871183d7
61 changeset: 1:ef3a871183d7
62 user: test
62 user: test
63 date: Thu Jan 01 00:00:00 1970 +0000
63 date: Thu Jan 01 00:00:00 1970 +0000
64 summary: b
64 summary: b
65
65
66 changeset: 0:9ab35a2d17cb
66 changeset: 0:9ab35a2d17cb
67 user: test
67 user: test
68 date: Thu Jan 01 00:00:00 1970 +0000
68 date: Thu Jan 01 00:00:00 1970 +0000
69 summary: a
69 summary: a
70
70
71
71
72 $ teststrip 4 4
72 $ teststrip 4 4
73 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
73 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
74 % before update 4, strip 4
74 % before update 4, strip 4
75 changeset: 4:443431ffac4f
75 changeset: 4:443431ffac4f
76 tag: tip
76 tag: tip
77 user: test
77 user: test
78 date: Thu Jan 01 00:00:00 1970 +0000
78 date: Thu Jan 01 00:00:00 1970 +0000
79 summary: e
79 summary: e
80
80
81 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
81 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
82 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
82 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
83 % after update 4, strip 4
83 % after update 4, strip 4
84 changeset: 3:65bd5f99a4a3
84 changeset: 3:65bd5f99a4a3
85 tag: tip
85 tag: tip
86 parent: 1:ef3a871183d7
86 parent: 1:ef3a871183d7
87 user: test
87 user: test
88 date: Thu Jan 01 00:00:00 1970 +0000
88 date: Thu Jan 01 00:00:00 1970 +0000
89 summary: d
89 summary: d
90
90
91 $ teststrip 4 3
91 $ teststrip 4 3
92 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
92 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
93 % before update 4, strip 3
93 % before update 4, strip 3
94 changeset: 4:443431ffac4f
94 changeset: 4:443431ffac4f
95 tag: tip
95 tag: tip
96 user: test
96 user: test
97 date: Thu Jan 01 00:00:00 1970 +0000
97 date: Thu Jan 01 00:00:00 1970 +0000
98 summary: e
98 summary: e
99
99
100 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
100 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
101 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
101 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
102 % after update 4, strip 3
102 % after update 4, strip 3
103 changeset: 1:ef3a871183d7
103 changeset: 1:ef3a871183d7
104 user: test
104 user: test
105 date: Thu Jan 01 00:00:00 1970 +0000
105 date: Thu Jan 01 00:00:00 1970 +0000
106 summary: b
106 summary: b
107
107
108 $ teststrip 1 4
108 $ teststrip 1 4
109 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
109 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
110 % before update 1, strip 4
110 % before update 1, strip 4
111 changeset: 1:ef3a871183d7
111 changeset: 1:ef3a871183d7
112 user: test
112 user: test
113 date: Thu Jan 01 00:00:00 1970 +0000
113 date: Thu Jan 01 00:00:00 1970 +0000
114 summary: b
114 summary: b
115
115
116 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
116 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
117 % after update 1, strip 4
117 % after update 1, strip 4
118 changeset: 1:ef3a871183d7
118 changeset: 1:ef3a871183d7
119 user: test
119 user: test
120 date: Thu Jan 01 00:00:00 1970 +0000
120 date: Thu Jan 01 00:00:00 1970 +0000
121 summary: b
121 summary: b
122
122
123 $ teststrip 4 2
123 $ teststrip 4 2
124 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
124 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
125 % before update 4, strip 2
125 % before update 4, strip 2
126 changeset: 4:443431ffac4f
126 changeset: 4:443431ffac4f
127 tag: tip
127 tag: tip
128 user: test
128 user: test
129 date: Thu Jan 01 00:00:00 1970 +0000
129 date: Thu Jan 01 00:00:00 1970 +0000
130 summary: e
130 summary: e
131
131
132 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
132 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
133 % after update 4, strip 2
133 % after update 4, strip 2
134 changeset: 3:443431ffac4f
134 changeset: 3:443431ffac4f
135 tag: tip
135 tag: tip
136 user: test
136 user: test
137 date: Thu Jan 01 00:00:00 1970 +0000
137 date: Thu Jan 01 00:00:00 1970 +0000
138 summary: e
138 summary: e
139
139
140 $ teststrip 4 1
140 $ teststrip 4 1
141 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
141 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
142 % before update 4, strip 1
142 % before update 4, strip 1
143 changeset: 4:264128213d29
143 changeset: 4:264128213d29
144 tag: tip
144 tag: tip
145 parent: 1:ef3a871183d7
145 parent: 1:ef3a871183d7
146 user: test
146 user: test
147 date: Thu Jan 01 00:00:00 1970 +0000
147 date: Thu Jan 01 00:00:00 1970 +0000
148 summary: c
148 summary: c
149
149
150 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
150 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
151 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
151 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
152 % after update 4, strip 1
152 % after update 4, strip 1
153 changeset: 0:9ab35a2d17cb
153 changeset: 0:9ab35a2d17cb
154 tag: tip
154 tag: tip
155 user: test
155 user: test
156 date: Thu Jan 01 00:00:00 1970 +0000
156 date: Thu Jan 01 00:00:00 1970 +0000
157 summary: a
157 summary: a
158
158
159 $ teststrip null 4
159 $ teststrip null 4
160 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
160 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
161 % before update null, strip 4
161 % before update null, strip 4
162 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
162 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
163 % after update null, strip 4
163 % after update null, strip 4
164
164
165 $ hg log
165 $ hg log
166 changeset: 4:264128213d29
166 changeset: 4:264128213d29
167 tag: tip
167 tag: tip
168 parent: 1:ef3a871183d7
168 parent: 1:ef3a871183d7
169 user: test
169 user: test
170 date: Thu Jan 01 00:00:00 1970 +0000
170 date: Thu Jan 01 00:00:00 1970 +0000
171 summary: c
171 summary: c
172
172
173 changeset: 3:443431ffac4f
173 changeset: 3:443431ffac4f
174 user: test
174 user: test
175 date: Thu Jan 01 00:00:00 1970 +0000
175 date: Thu Jan 01 00:00:00 1970 +0000
176 summary: e
176 summary: e
177
177
178 changeset: 2:65bd5f99a4a3
178 changeset: 2:65bd5f99a4a3
179 user: test
179 user: test
180 date: Thu Jan 01 00:00:00 1970 +0000
180 date: Thu Jan 01 00:00:00 1970 +0000
181 summary: d
181 summary: d
182
182
183 changeset: 1:ef3a871183d7
183 changeset: 1:ef3a871183d7
184 user: test
184 user: test
185 date: Thu Jan 01 00:00:00 1970 +0000
185 date: Thu Jan 01 00:00:00 1970 +0000
186 summary: b
186 summary: b
187
187
188 changeset: 0:9ab35a2d17cb
188 changeset: 0:9ab35a2d17cb
189 user: test
189 user: test
190 date: Thu Jan 01 00:00:00 1970 +0000
190 date: Thu Jan 01 00:00:00 1970 +0000
191 summary: a
191 summary: a
192
192
193 $ hg up -C 4
193 $ hg up -C 4
194 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
194 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
195 $ hg parents
195 $ hg parents
196 changeset: 4:264128213d29
196 changeset: 4:264128213d29
197 tag: tip
197 tag: tip
198 parent: 1:ef3a871183d7
198 parent: 1:ef3a871183d7
199 user: test
199 user: test
200 date: Thu Jan 01 00:00:00 1970 +0000
200 date: Thu Jan 01 00:00:00 1970 +0000
201 summary: c
201 summary: c
202
202
203
203
204 $ hg --traceback strip 4
204 $ hg --traceback strip 4
205 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
205 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
206 saved backup bundle to $TESTTMP/test/.hg/strip-backup/264128213d29-0b39d6bf-backup.hg (glob)
206 saved backup bundle to $TESTTMP/test/.hg/strip-backup/264128213d29-0b39d6bf-backup.hg (glob)
207 $ hg parents
207 $ hg parents
208 changeset: 1:ef3a871183d7
208 changeset: 1:ef3a871183d7
209 user: test
209 user: test
210 date: Thu Jan 01 00:00:00 1970 +0000
210 date: Thu Jan 01 00:00:00 1970 +0000
211 summary: b
211 summary: b
212
212
213 $ hg debugbundle .hg/strip-backup/*
213 $ hg debugbundle .hg/strip-backup/*
214 Stream params: sortdict([('Compression', 'BZ')])
214 Stream params: sortdict([('Compression', 'BZ')])
215 changegroup -- "sortdict([('version', '02'), ('nbchanges', '1')])"
215 changegroup -- "sortdict([('version', '02'), ('nbchanges', '1')])"
216 264128213d290d868c54642d13aeaa3675551a78
216 264128213d290d868c54642d13aeaa3675551a78
217 phase-heads -- 'sortdict()'
217 phase-heads -- 'sortdict()'
218 264128213d290d868c54642d13aeaa3675551a78 draft
218 264128213d290d868c54642d13aeaa3675551a78 draft
219 $ hg pull .hg/strip-backup/*
219 $ hg pull .hg/strip-backup/*
220 pulling from .hg/strip-backup/264128213d29-0b39d6bf-backup.hg
220 pulling from .hg/strip-backup/264128213d29-0b39d6bf-backup.hg
221 searching for changes
221 searching for changes
222 adding changesets
222 adding changesets
223 adding manifests
223 adding manifests
224 adding file changes
224 adding file changes
225 added 1 changesets with 0 changes to 0 files (+1 heads)
225 added 1 changesets with 0 changes to 0 files (+1 heads)
226 (run 'hg heads' to see heads, 'hg merge' to merge)
226 (run 'hg heads' to see heads, 'hg merge' to merge)
227 $ rm .hg/strip-backup/*
227 $ rm .hg/strip-backup/*
228 $ hg log --graph
228 $ hg log --graph
229 o changeset: 4:264128213d29
229 o changeset: 4:264128213d29
230 | tag: tip
230 | tag: tip
231 | parent: 1:ef3a871183d7
231 | parent: 1:ef3a871183d7
232 | user: test
232 | user: test
233 | date: Thu Jan 01 00:00:00 1970 +0000
233 | date: Thu Jan 01 00:00:00 1970 +0000
234 | summary: c
234 | summary: c
235 |
235 |
236 | o changeset: 3:443431ffac4f
236 | o changeset: 3:443431ffac4f
237 | | user: test
237 | | user: test
238 | | date: Thu Jan 01 00:00:00 1970 +0000
238 | | date: Thu Jan 01 00:00:00 1970 +0000
239 | | summary: e
239 | | summary: e
240 | |
240 | |
241 | o changeset: 2:65bd5f99a4a3
241 | o changeset: 2:65bd5f99a4a3
242 |/ user: test
242 |/ user: test
243 | date: Thu Jan 01 00:00:00 1970 +0000
243 | date: Thu Jan 01 00:00:00 1970 +0000
244 | summary: d
244 | summary: d
245 |
245 |
246 @ changeset: 1:ef3a871183d7
246 @ changeset: 1:ef3a871183d7
247 | user: test
247 | user: test
248 | date: Thu Jan 01 00:00:00 1970 +0000
248 | date: Thu Jan 01 00:00:00 1970 +0000
249 | summary: b
249 | summary: b
250 |
250 |
251 o changeset: 0:9ab35a2d17cb
251 o changeset: 0:9ab35a2d17cb
252 user: test
252 user: test
253 date: Thu Jan 01 00:00:00 1970 +0000
253 date: Thu Jan 01 00:00:00 1970 +0000
254 summary: a
254 summary: a
255
255
256 $ hg up -C 2
256 $ hg up -C 2
257 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
257 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
258 $ hg merge 4
258 $ hg merge 4
259 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
259 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
260 (branch merge, don't forget to commit)
260 (branch merge, don't forget to commit)
261
261
262 before strip of merge parent
262 before strip of merge parent
263
263
264 $ hg parents
264 $ hg parents
265 changeset: 2:65bd5f99a4a3
265 changeset: 2:65bd5f99a4a3
266 user: test
266 user: test
267 date: Thu Jan 01 00:00:00 1970 +0000
267 date: Thu Jan 01 00:00:00 1970 +0000
268 summary: d
268 summary: d
269
269
270 changeset: 4:264128213d29
270 changeset: 4:264128213d29
271 tag: tip
271 tag: tip
272 parent: 1:ef3a871183d7
272 parent: 1:ef3a871183d7
273 user: test
273 user: test
274 date: Thu Jan 01 00:00:00 1970 +0000
274 date: Thu Jan 01 00:00:00 1970 +0000
275 summary: c
275 summary: c
276
276
277 $ hg strip 4
277 $ hg strip 4
278 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
278 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
279 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
279 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
280
280
281 after strip of merge parent
281 after strip of merge parent
282
282
283 $ hg parents
283 $ hg parents
284 changeset: 1:ef3a871183d7
284 changeset: 1:ef3a871183d7
285 user: test
285 user: test
286 date: Thu Jan 01 00:00:00 1970 +0000
286 date: Thu Jan 01 00:00:00 1970 +0000
287 summary: b
287 summary: b
288
288
289 $ restore
289 $ restore
290
290
291 $ hg up
291 $ hg up
292 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
292 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
293 updated to "264128213d29: c"
293 updated to "264128213d29: c"
294 1 other heads for branch "default"
294 1 other heads for branch "default"
295 $ hg log -G
295 $ hg log -G
296 @ changeset: 4:264128213d29
296 @ changeset: 4:264128213d29
297 | tag: tip
297 | tag: tip
298 | parent: 1:ef3a871183d7
298 | parent: 1:ef3a871183d7
299 | user: test
299 | user: test
300 | date: Thu Jan 01 00:00:00 1970 +0000
300 | date: Thu Jan 01 00:00:00 1970 +0000
301 | summary: c
301 | summary: c
302 |
302 |
303 | o changeset: 3:443431ffac4f
303 | o changeset: 3:443431ffac4f
304 | | user: test
304 | | user: test
305 | | date: Thu Jan 01 00:00:00 1970 +0000
305 | | date: Thu Jan 01 00:00:00 1970 +0000
306 | | summary: e
306 | | summary: e
307 | |
307 | |
308 | o changeset: 2:65bd5f99a4a3
308 | o changeset: 2:65bd5f99a4a3
309 |/ user: test
309 |/ user: test
310 | date: Thu Jan 01 00:00:00 1970 +0000
310 | date: Thu Jan 01 00:00:00 1970 +0000
311 | summary: d
311 | summary: d
312 |
312 |
313 o changeset: 1:ef3a871183d7
313 o changeset: 1:ef3a871183d7
314 | user: test
314 | user: test
315 | date: Thu Jan 01 00:00:00 1970 +0000
315 | date: Thu Jan 01 00:00:00 1970 +0000
316 | summary: b
316 | summary: b
317 |
317 |
318 o changeset: 0:9ab35a2d17cb
318 o changeset: 0:9ab35a2d17cb
319 user: test
319 user: test
320 date: Thu Jan 01 00:00:00 1970 +0000
320 date: Thu Jan 01 00:00:00 1970 +0000
321 summary: a
321 summary: a
322
322
323
323
324 2 is parent of 3, only one strip should happen
324 2 is parent of 3, only one strip should happen
325
325
326 $ hg strip "roots(2)" 3
326 $ hg strip "roots(2)" 3
327 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
327 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
328 $ hg log -G
328 $ hg log -G
329 @ changeset: 2:264128213d29
329 @ changeset: 2:264128213d29
330 | tag: tip
330 | tag: tip
331 | user: test
331 | user: test
332 | date: Thu Jan 01 00:00:00 1970 +0000
332 | date: Thu Jan 01 00:00:00 1970 +0000
333 | summary: c
333 | summary: c
334 |
334 |
335 o changeset: 1:ef3a871183d7
335 o changeset: 1:ef3a871183d7
336 | user: test
336 | user: test
337 | date: Thu Jan 01 00:00:00 1970 +0000
337 | date: Thu Jan 01 00:00:00 1970 +0000
338 | summary: b
338 | summary: b
339 |
339 |
340 o changeset: 0:9ab35a2d17cb
340 o changeset: 0:9ab35a2d17cb
341 user: test
341 user: test
342 date: Thu Jan 01 00:00:00 1970 +0000
342 date: Thu Jan 01 00:00:00 1970 +0000
343 summary: a
343 summary: a
344
344
345 $ restore
345 $ restore
346 $ hg log -G
346 $ hg log -G
347 o changeset: 4:443431ffac4f
347 o changeset: 4:443431ffac4f
348 | tag: tip
348 | tag: tip
349 | user: test
349 | user: test
350 | date: Thu Jan 01 00:00:00 1970 +0000
350 | date: Thu Jan 01 00:00:00 1970 +0000
351 | summary: e
351 | summary: e
352 |
352 |
353 o changeset: 3:65bd5f99a4a3
353 o changeset: 3:65bd5f99a4a3
354 | parent: 1:ef3a871183d7
354 | parent: 1:ef3a871183d7
355 | user: test
355 | user: test
356 | date: Thu Jan 01 00:00:00 1970 +0000
356 | date: Thu Jan 01 00:00:00 1970 +0000
357 | summary: d
357 | summary: d
358 |
358 |
359 | @ changeset: 2:264128213d29
359 | @ changeset: 2:264128213d29
360 |/ user: test
360 |/ user: test
361 | date: Thu Jan 01 00:00:00 1970 +0000
361 | date: Thu Jan 01 00:00:00 1970 +0000
362 | summary: c
362 | summary: c
363 |
363 |
364 o changeset: 1:ef3a871183d7
364 o changeset: 1:ef3a871183d7
365 | user: test
365 | user: test
366 | date: Thu Jan 01 00:00:00 1970 +0000
366 | date: Thu Jan 01 00:00:00 1970 +0000
367 | summary: b
367 | summary: b
368 |
368 |
369 o changeset: 0:9ab35a2d17cb
369 o changeset: 0:9ab35a2d17cb
370 user: test
370 user: test
371 date: Thu Jan 01 00:00:00 1970 +0000
371 date: Thu Jan 01 00:00:00 1970 +0000
372 summary: a
372 summary: a
373
373
374 Failed hook while applying "saveheads" bundle.
374 Failed hook while applying "saveheads" bundle.
375
375
376 $ hg strip 2 --config hooks.pretxnchangegroup.bad=false
376 $ hg strip 2 --config hooks.pretxnchangegroup.bad=false
377 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
377 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
378 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
378 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
379 transaction abort!
379 transaction abort!
380 rollback completed
380 rollback completed
381 strip failed, backup bundle stored in '$TESTTMP/test/.hg/strip-backup/*-backup.hg' (glob)
381 strip failed, backup bundle stored in '$TESTTMP/test/.hg/strip-backup/*-backup.hg' (glob)
382 strip failed, unrecovered changes stored in '$TESTTMP/test/.hg/strip-backup/*-temp.hg' (glob)
382 strip failed, unrecovered changes stored in '$TESTTMP/test/.hg/strip-backup/*-temp.hg' (glob)
383 (fix the problem, then recover the changesets with "hg unbundle '$TESTTMP/test/.hg/strip-backup/*-temp.hg'") (glob)
383 (fix the problem, then recover the changesets with "hg unbundle '$TESTTMP/test/.hg/strip-backup/*-temp.hg'") (glob)
384 abort: pretxnchangegroup.bad hook exited with status 1
384 abort: pretxnchangegroup.bad hook exited with status 1
385 [255]
385 [255]
386 $ restore
386 $ restore
387 $ hg log -G
387 $ hg log -G
388 o changeset: 4:443431ffac4f
388 o changeset: 4:443431ffac4f
389 | tag: tip
389 | tag: tip
390 | user: test
390 | user: test
391 | date: Thu Jan 01 00:00:00 1970 +0000
391 | date: Thu Jan 01 00:00:00 1970 +0000
392 | summary: e
392 | summary: e
393 |
393 |
394 o changeset: 3:65bd5f99a4a3
394 o changeset: 3:65bd5f99a4a3
395 | parent: 1:ef3a871183d7
395 | parent: 1:ef3a871183d7
396 | user: test
396 | user: test
397 | date: Thu Jan 01 00:00:00 1970 +0000
397 | date: Thu Jan 01 00:00:00 1970 +0000
398 | summary: d
398 | summary: d
399 |
399 |
400 | o changeset: 2:264128213d29
400 | o changeset: 2:264128213d29
401 |/ user: test
401 |/ user: test
402 | date: Thu Jan 01 00:00:00 1970 +0000
402 | date: Thu Jan 01 00:00:00 1970 +0000
403 | summary: c
403 | summary: c
404 |
404 |
405 @ changeset: 1:ef3a871183d7
405 @ changeset: 1:ef3a871183d7
406 | user: test
406 | user: test
407 | date: Thu Jan 01 00:00:00 1970 +0000
407 | date: Thu Jan 01 00:00:00 1970 +0000
408 | summary: b
408 | summary: b
409 |
409 |
410 o changeset: 0:9ab35a2d17cb
410 o changeset: 0:9ab35a2d17cb
411 user: test
411 user: test
412 date: Thu Jan 01 00:00:00 1970 +0000
412 date: Thu Jan 01 00:00:00 1970 +0000
413 summary: a
413 summary: a
414
414
415
415
416 2 different branches: 2 strips
416 2 different branches: 2 strips
417
417
418 $ hg strip 2 4
418 $ hg strip 2 4
419 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
419 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
420 $ hg log -G
420 $ hg log -G
421 o changeset: 2:65bd5f99a4a3
421 o changeset: 2:65bd5f99a4a3
422 | tag: tip
422 | tag: tip
423 | user: test
423 | user: test
424 | date: Thu Jan 01 00:00:00 1970 +0000
424 | date: Thu Jan 01 00:00:00 1970 +0000
425 | summary: d
425 | summary: d
426 |
426 |
427 @ changeset: 1:ef3a871183d7
427 @ changeset: 1:ef3a871183d7
428 | user: test
428 | user: test
429 | date: Thu Jan 01 00:00:00 1970 +0000
429 | date: Thu Jan 01 00:00:00 1970 +0000
430 | summary: b
430 | summary: b
431 |
431 |
432 o changeset: 0:9ab35a2d17cb
432 o changeset: 0:9ab35a2d17cb
433 user: test
433 user: test
434 date: Thu Jan 01 00:00:00 1970 +0000
434 date: Thu Jan 01 00:00:00 1970 +0000
435 summary: a
435 summary: a
436
436
437 $ restore
437 $ restore
438
438
439 2 different branches and a common ancestor: 1 strip
439 2 different branches and a common ancestor: 1 strip
440
440
441 $ hg strip 1 "2|4"
441 $ hg strip 1 "2|4"
442 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
442 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
443 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
443 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
444 $ restore
444 $ restore
445
445
446 verify fncache is kept up-to-date
446 verify fncache is kept up-to-date
447
447
448 $ touch a
448 $ touch a
449 $ hg ci -qAm a
449 $ hg ci -qAm a
450 $ cat .hg/store/fncache | sort
450 $ cat .hg/store/fncache | sort
451 data/a.i
451 data/a.i
452 data/bar.i
452 data/bar.i
453 $ hg strip tip
453 $ hg strip tip
454 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
454 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
455 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
455 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
456 $ cat .hg/store/fncache
456 $ cat .hg/store/fncache
457 data/bar.i
457 data/bar.i
458
458
459 stripping an empty revset
459 stripping an empty revset
460
460
461 $ hg strip "1 and not 1"
461 $ hg strip "1 and not 1"
462 abort: empty revision set
462 abort: empty revision set
463 [255]
463 [255]
464
464
465 remove branchy history for qimport tests
465 remove branchy history for qimport tests
466
466
467 $ hg strip 3
467 $ hg strip 3
468 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
468 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
469
469
470
470
471 strip of applied mq should cleanup status file
471 strip of applied mq should cleanup status file
472
472
473 $ echo "mq=" >> $HGRCPATH
473 $ echo "mq=" >> $HGRCPATH
474 $ hg up -C 3
474 $ hg up -C 3
475 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
475 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
476 $ echo fooagain >> bar
476 $ echo fooagain >> bar
477 $ hg ci -mf
477 $ hg ci -mf
478 $ hg qimport -r tip:2
478 $ hg qimport -r tip:2
479
479
480 applied patches before strip
480 applied patches before strip
481
481
482 $ hg qapplied
482 $ hg qapplied
483 d
483 d
484 e
484 e
485 f
485 f
486
486
487 stripping revision in queue
487 stripping revision in queue
488
488
489 $ hg strip 3
489 $ hg strip 3
490 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
490 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
491 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
491 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
492
492
493 applied patches after stripping rev in queue
493 applied patches after stripping rev in queue
494
494
495 $ hg qapplied
495 $ hg qapplied
496 d
496 d
497
497
498 stripping ancestor of queue
498 stripping ancestor of queue
499
499
500 $ hg strip 1
500 $ hg strip 1
501 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
501 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
502 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
502 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
503
503
504 applied patches after stripping ancestor of queue
504 applied patches after stripping ancestor of queue
505
505
506 $ hg qapplied
506 $ hg qapplied
507
507
508 Verify strip protects against stripping wc parent when there are uncommitted mods
508 Verify strip protects against stripping wc parent when there are uncommitted mods
509
509
510 $ echo b > b
510 $ echo b > b
511 $ echo bb > bar
511 $ echo bb > bar
512 $ hg add b
512 $ hg add b
513 $ hg ci -m 'b'
513 $ hg ci -m 'b'
514 $ hg log --graph
514 $ hg log --graph
515 @ changeset: 1:76dcf9fab855
515 @ changeset: 1:76dcf9fab855
516 | tag: tip
516 | tag: tip
517 | user: test
517 | user: test
518 | date: Thu Jan 01 00:00:00 1970 +0000
518 | date: Thu Jan 01 00:00:00 1970 +0000
519 | summary: b
519 | summary: b
520 |
520 |
521 o changeset: 0:9ab35a2d17cb
521 o changeset: 0:9ab35a2d17cb
522 user: test
522 user: test
523 date: Thu Jan 01 00:00:00 1970 +0000
523 date: Thu Jan 01 00:00:00 1970 +0000
524 summary: a
524 summary: a
525
525
526 $ hg up 0
526 $ hg up 0
527 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
527 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
528 $ echo c > bar
528 $ echo c > bar
529 $ hg up -t false
529 $ hg up -t false
530 merging bar
530 merging bar
531 merging bar failed!
531 merging bar failed!
532 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
532 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
533 use 'hg resolve' to retry unresolved file merges
533 use 'hg resolve' to retry unresolved file merges
534 [1]
534 [1]
535 $ hg sum
535 $ hg sum
536 parent: 1:76dcf9fab855 tip
536 parent: 1:76dcf9fab855 tip
537 b
537 b
538 branch: default
538 branch: default
539 commit: 1 modified, 1 unknown, 1 unresolved
539 commit: 1 modified, 1 unknown, 1 unresolved
540 update: (current)
540 update: (current)
541 phases: 2 draft
541 phases: 2 draft
542 mq: 3 unapplied
542 mq: 3 unapplied
543
543
544 $ echo c > b
544 $ echo c > b
545 $ hg strip tip
545 $ hg strip tip
546 abort: local changes found
546 abort: local changes found
547 [255]
547 [255]
548 $ hg strip tip --keep
548 $ hg strip tip --keep
549 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
549 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
550 $ hg log --graph
550 $ hg log --graph
551 @ changeset: 0:9ab35a2d17cb
551 @ changeset: 0:9ab35a2d17cb
552 tag: tip
552 tag: tip
553 user: test
553 user: test
554 date: Thu Jan 01 00:00:00 1970 +0000
554 date: Thu Jan 01 00:00:00 1970 +0000
555 summary: a
555 summary: a
556
556
557 $ hg status
557 $ hg status
558 M bar
558 M bar
559 ? b
559 ? b
560 ? bar.orig
560 ? bar.orig
561
561
562 $ rm bar.orig
562 $ rm bar.orig
563 $ hg sum
563 $ hg sum
564 parent: 0:9ab35a2d17cb tip
564 parent: 0:9ab35a2d17cb tip
565 a
565 a
566 branch: default
566 branch: default
567 commit: 1 modified, 1 unknown
567 commit: 1 modified, 1 unknown
568 update: (current)
568 update: (current)
569 phases: 1 draft
569 phases: 1 draft
570 mq: 3 unapplied
570 mq: 3 unapplied
571
571
572 Strip adds, removes, modifies with --keep
572 Strip adds, removes, modifies with --keep
573
573
574 $ touch b
574 $ touch b
575 $ hg add b
575 $ hg add b
576 $ hg commit -mb
576 $ hg commit -mb
577 $ touch c
577 $ touch c
578
578
579 ... with a clean working dir
579 ... with a clean working dir
580
580
581 $ hg add c
581 $ hg add c
582 $ hg rm bar
582 $ hg rm bar
583 $ hg commit -mc
583 $ hg commit -mc
584 $ hg status
584 $ hg status
585 $ hg strip --keep tip
585 $ hg strip --keep tip
586 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
586 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
587 $ hg status
587 $ hg status
588 ! bar
588 ! bar
589 ? c
589 ? c
590
590
591 ... with a dirty working dir
591 ... with a dirty working dir
592
592
593 $ hg add c
593 $ hg add c
594 $ hg rm bar
594 $ hg rm bar
595 $ hg commit -mc
595 $ hg commit -mc
596 $ hg status
596 $ hg status
597 $ echo b > b
597 $ echo b > b
598 $ echo d > d
598 $ echo d > d
599 $ hg strip --keep tip
599 $ hg strip --keep tip
600 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
600 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
601 $ hg status
601 $ hg status
602 M b
602 M b
603 ! bar
603 ! bar
604 ? c
604 ? c
605 ? d
605 ? d
606
606
607 ... after updating the dirstate
607 ... after updating the dirstate
608 $ hg add c
608 $ hg add c
609 $ hg commit -mc
609 $ hg commit -mc
610 $ hg rm c
610 $ hg rm c
611 $ hg commit -mc
611 $ hg commit -mc
612 $ hg strip --keep '.^' -q
612 $ hg strip --keep '.^' -q
613 $ cd ..
613 $ cd ..
614
614
615 stripping many nodes on a complex graph (issue3299)
615 stripping many nodes on a complex graph (issue3299)
616
616
617 $ hg init issue3299
617 $ hg init issue3299
618 $ cd issue3299
618 $ cd issue3299
619 $ hg debugbuilddag '@a.:a@b.:b.:x<a@a.:a<b@b.:b<a@a.:a'
619 $ hg debugbuilddag '@a.:a@b.:b.:x<a@a.:a<b@b.:b<a@a.:a'
620 $ hg strip 'not ancestors(x)'
620 $ hg strip 'not ancestors(x)'
621 saved backup bundle to $TESTTMP/issue3299/.hg/strip-backup/*-backup.hg (glob)
621 saved backup bundle to $TESTTMP/issue3299/.hg/strip-backup/*-backup.hg (glob)
622
622
623 test hg strip -B bookmark
623 test hg strip -B bookmark
624
624
625 $ cd ..
625 $ cd ..
626 $ hg init bookmarks
626 $ hg init bookmarks
627 $ cd bookmarks
627 $ cd bookmarks
628 $ hg debugbuilddag '..<2.*1/2:m<2+3:c<m+3:a<2.:b<m+2:d<2.:e<m+1:f'
628 $ hg debugbuilddag '..<2.*1/2:m<2+3:c<m+3:a<2.:b<m+2:d<2.:e<m+1:f'
629 $ hg bookmark -r 'a' 'todelete'
629 $ hg bookmark -r 'a' 'todelete'
630 $ hg bookmark -r 'b' 'B'
630 $ hg bookmark -r 'b' 'B'
631 $ hg bookmark -r 'b' 'nostrip'
631 $ hg bookmark -r 'b' 'nostrip'
632 $ hg bookmark -r 'c' 'delete'
632 $ hg bookmark -r 'c' 'delete'
633 $ hg bookmark -r 'd' 'multipledelete1'
633 $ hg bookmark -r 'd' 'multipledelete1'
634 $ hg bookmark -r 'e' 'multipledelete2'
634 $ hg bookmark -r 'e' 'multipledelete2'
635 $ hg bookmark -r 'f' 'singlenode1'
635 $ hg bookmark -r 'f' 'singlenode1'
636 $ hg bookmark -r 'f' 'singlenode2'
636 $ hg bookmark -r 'f' 'singlenode2'
637 $ hg up -C todelete
637 $ hg up -C todelete
638 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
638 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
639 (activating bookmark todelete)
639 (activating bookmark todelete)
640 $ hg strip -B nostrip
640 $ hg strip -B nostrip
641 bookmark 'nostrip' deleted
641 bookmark 'nostrip' deleted
642 abort: empty revision set
642 abort: empty revision set
643 [255]
643 [255]
644 $ hg strip -B todelete
644 $ hg strip -B todelete
645 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
645 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
646 saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/*-backup.hg (glob)
646 saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/*-backup.hg (glob)
647 bookmark 'todelete' deleted
647 bookmark 'todelete' deleted
648 $ hg id -ir dcbb326fdec2
648 $ hg id -ir dcbb326fdec2
649 abort: unknown revision 'dcbb326fdec2'!
649 abort: unknown revision 'dcbb326fdec2'!
650 [255]
650 [255]
651 $ hg id -ir d62d843c9a01
651 $ hg id -ir d62d843c9a01
652 d62d843c9a01
652 d62d843c9a01
653 $ hg bookmarks
653 $ hg bookmarks
654 B 9:ff43616e5d0f
654 B 9:ff43616e5d0f
655 delete 6:2702dd0c91e7
655 delete 6:2702dd0c91e7
656 multipledelete1 11:e46a4836065c
656 multipledelete1 11:e46a4836065c
657 multipledelete2 12:b4594d867745
657 multipledelete2 12:b4594d867745
658 singlenode1 13:43227190fef8
658 singlenode1 13:43227190fef8
659 singlenode2 13:43227190fef8
659 singlenode2 13:43227190fef8
660 $ hg strip -B multipledelete1 -B multipledelete2
660 $ hg strip -B multipledelete1 -B multipledelete2
661 saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/e46a4836065c-89ec65c2-backup.hg (glob)
661 saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/e46a4836065c-89ec65c2-backup.hg (glob)
662 bookmark 'multipledelete1' deleted
662 bookmark 'multipledelete1' deleted
663 bookmark 'multipledelete2' deleted
663 bookmark 'multipledelete2' deleted
664 $ hg id -ir e46a4836065c
664 $ hg id -ir e46a4836065c
665 abort: unknown revision 'e46a4836065c'!
665 abort: unknown revision 'e46a4836065c'!
666 [255]
666 [255]
667 $ hg id -ir b4594d867745
667 $ hg id -ir b4594d867745
668 abort: unknown revision 'b4594d867745'!
668 abort: unknown revision 'b4594d867745'!
669 [255]
669 [255]
670 $ hg strip -B singlenode1 -B singlenode2
670 $ hg strip -B singlenode1 -B singlenode2
671 saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/43227190fef8-8da858f2-backup.hg (glob)
671 saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/43227190fef8-8da858f2-backup.hg (glob)
672 bookmark 'singlenode1' deleted
672 bookmark 'singlenode1' deleted
673 bookmark 'singlenode2' deleted
673 bookmark 'singlenode2' deleted
674 $ hg id -ir 43227190fef8
674 $ hg id -ir 43227190fef8
675 abort: unknown revision '43227190fef8'!
675 abort: unknown revision '43227190fef8'!
676 [255]
676 [255]
677 $ hg strip -B unknownbookmark
677 $ hg strip -B unknownbookmark
678 abort: bookmark 'unknownbookmark' not found
678 abort: bookmark 'unknownbookmark' not found
679 [255]
679 [255]
680 $ hg strip -B unknownbookmark1 -B unknownbookmark2
680 $ hg strip -B unknownbookmark1 -B unknownbookmark2
681 abort: bookmark 'unknownbookmark1,unknownbookmark2' not found
681 abort: bookmark 'unknownbookmark1,unknownbookmark2' not found
682 [255]
682 [255]
683 $ hg strip -B delete -B unknownbookmark
683 $ hg strip -B delete -B unknownbookmark
684 abort: bookmark 'unknownbookmark' not found
684 abort: bookmark 'unknownbookmark' not found
685 [255]
685 [255]
686 $ hg strip -B delete
686 $ hg strip -B delete
687 saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/*-backup.hg (glob)
687 saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/*-backup.hg (glob)
688 bookmark 'delete' deleted
688 bookmark 'delete' deleted
689 $ hg id -ir 6:2702dd0c91e7
689 $ hg id -ir 6:2702dd0c91e7
690 abort: unknown revision '2702dd0c91e7'!
690 abort: unknown revision '2702dd0c91e7'!
691 [255]
691 [255]
692 $ hg update B
692 $ hg update B
693 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
693 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
694 (activating bookmark B)
694 (activating bookmark B)
695 $ echo a > a
695 $ echo a > a
696 $ hg add a
696 $ hg add a
697 $ hg strip -B B
697 $ hg strip -B B
698 abort: local changes found
698 abort: local changes found
699 [255]
699 [255]
700 $ hg bookmarks
700 $ hg bookmarks
701 * B 6:ff43616e5d0f
701 * B 6:ff43616e5d0f
702
702
703 Make sure no one adds back a -b option:
703 Make sure no one adds back a -b option:
704
704
705 $ hg strip -b tip
705 $ hg strip -b tip
706 hg strip: option -b not recognized
706 hg strip: option -b not recognized
707 hg strip [-k] [-f] [-B bookmark] [-r] REV...
707 hg strip [-k] [-f] [-B bookmark] [-r] REV...
708
708
709 strip changesets and all their descendants from the repository
709 strip changesets and all their descendants from the repository
710
710
711 (use 'hg help -e strip' to show help for the strip extension)
711 (use 'hg help -e strip' to show help for the strip extension)
712
712
713 options ([+] can be repeated):
713 options ([+] can be repeated):
714
714
715 -r --rev REV [+] strip specified revision (optional, can specify
715 -r --rev REV [+] strip specified revision (optional, can specify
716 revisions without this option)
716 revisions without this option)
717 -f --force force removal of changesets, discard uncommitted
717 -f --force force removal of changesets, discard uncommitted
718 changes (no backup)
718 changes (no backup)
719 --no-backup no backups
719 --no-backup no backups
720 -k --keep do not modify working directory during strip
720 -k --keep do not modify working directory during strip
721 -B --bookmark VALUE [+] remove revs only reachable from given bookmark
721 -B --bookmark VALUE [+] remove revs only reachable from given bookmark
722 --mq operate on patch repository
722 --mq operate on patch repository
723
723
724 (use 'hg strip -h' to show more help)
724 (use 'hg strip -h' to show more help)
725 [255]
725 [255]
726
726
727 $ cd ..
727 $ cd ..
728
728
729 Verify bundles don't get overwritten:
729 Verify bundles don't get overwritten:
730
730
731 $ hg init doublebundle
731 $ hg init doublebundle
732 $ cd doublebundle
732 $ cd doublebundle
733 $ touch a
733 $ touch a
734 $ hg commit -Aqm a
734 $ hg commit -Aqm a
735 $ touch b
735 $ touch b
736 $ hg commit -Aqm b
736 $ hg commit -Aqm b
737 $ hg strip -r 0
737 $ hg strip -r 0
738 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
738 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
739 saved backup bundle to $TESTTMP/doublebundle/.hg/strip-backup/3903775176ed-e68910bd-backup.hg (glob)
739 saved backup bundle to $TESTTMP/doublebundle/.hg/strip-backup/3903775176ed-e68910bd-backup.hg (glob)
740 $ ls .hg/strip-backup
740 $ ls .hg/strip-backup
741 3903775176ed-e68910bd-backup.hg
741 3903775176ed-e68910bd-backup.hg
742 $ hg pull -q -r 3903775176ed .hg/strip-backup/3903775176ed-e68910bd-backup.hg
742 $ hg pull -q -r 3903775176ed .hg/strip-backup/3903775176ed-e68910bd-backup.hg
743 $ hg strip -r 0
743 $ hg strip -r 0
744 saved backup bundle to $TESTTMP/doublebundle/.hg/strip-backup/3903775176ed-54390173-backup.hg (glob)
744 saved backup bundle to $TESTTMP/doublebundle/.hg/strip-backup/3903775176ed-54390173-backup.hg (glob)
745 $ ls .hg/strip-backup
745 $ ls .hg/strip-backup
746 3903775176ed-54390173-backup.hg
746 3903775176ed-54390173-backup.hg
747 3903775176ed-e68910bd-backup.hg
747 3903775176ed-e68910bd-backup.hg
748 $ cd ..
748 $ cd ..
749
749
750 Test that we only bundle the stripped changesets (issue4736)
750 Test that we only bundle the stripped changesets (issue4736)
751 ------------------------------------------------------------
751 ------------------------------------------------------------
752
752
753 initialization (previous repo is empty anyway)
753 initialization (previous repo is empty anyway)
754
754
755 $ hg init issue4736
755 $ hg init issue4736
756 $ cd issue4736
756 $ cd issue4736
757 $ echo a > a
757 $ echo a > a
758 $ hg add a
758 $ hg add a
759 $ hg commit -m commitA
759 $ hg commit -m commitA
760 $ echo b > b
760 $ echo b > b
761 $ hg add b
761 $ hg add b
762 $ hg commit -m commitB
762 $ hg commit -m commitB
763 $ echo c > c
763 $ echo c > c
764 $ hg add c
764 $ hg add c
765 $ hg commit -m commitC
765 $ hg commit -m commitC
766 $ hg up 'desc(commitB)'
766 $ hg up 'desc(commitB)'
767 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
767 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
768 $ echo d > d
768 $ echo d > d
769 $ hg add d
769 $ hg add d
770 $ hg commit -m commitD
770 $ hg commit -m commitD
771 created new head
771 created new head
772 $ hg up 'desc(commitC)'
772 $ hg up 'desc(commitC)'
773 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
773 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
774 $ hg merge 'desc(commitD)'
774 $ hg merge 'desc(commitD)'
775 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
775 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
776 (branch merge, don't forget to commit)
776 (branch merge, don't forget to commit)
777 $ hg ci -m 'mergeCD'
777 $ hg ci -m 'mergeCD'
778 $ hg log -G
778 $ hg log -G
779 @ changeset: 4:d8db9d137221
779 @ changeset: 4:d8db9d137221
780 |\ tag: tip
780 |\ tag: tip
781 | | parent: 2:5c51d8d6557d
781 | | parent: 2:5c51d8d6557d
782 | | parent: 3:6625a5168474
782 | | parent: 3:6625a5168474
783 | | user: test
783 | | user: test
784 | | date: Thu Jan 01 00:00:00 1970 +0000
784 | | date: Thu Jan 01 00:00:00 1970 +0000
785 | | summary: mergeCD
785 | | summary: mergeCD
786 | |
786 | |
787 | o changeset: 3:6625a5168474
787 | o changeset: 3:6625a5168474
788 | | parent: 1:eca11cf91c71
788 | | parent: 1:eca11cf91c71
789 | | user: test
789 | | user: test
790 | | date: Thu Jan 01 00:00:00 1970 +0000
790 | | date: Thu Jan 01 00:00:00 1970 +0000
791 | | summary: commitD
791 | | summary: commitD
792 | |
792 | |
793 o | changeset: 2:5c51d8d6557d
793 o | changeset: 2:5c51d8d6557d
794 |/ user: test
794 |/ user: test
795 | date: Thu Jan 01 00:00:00 1970 +0000
795 | date: Thu Jan 01 00:00:00 1970 +0000
796 | summary: commitC
796 | summary: commitC
797 |
797 |
798 o changeset: 1:eca11cf91c71
798 o changeset: 1:eca11cf91c71
799 | user: test
799 | user: test
800 | date: Thu Jan 01 00:00:00 1970 +0000
800 | date: Thu Jan 01 00:00:00 1970 +0000
801 | summary: commitB
801 | summary: commitB
802 |
802 |
803 o changeset: 0:105141ef12d0
803 o changeset: 0:105141ef12d0
804 user: test
804 user: test
805 date: Thu Jan 01 00:00:00 1970 +0000
805 date: Thu Jan 01 00:00:00 1970 +0000
806 summary: commitA
806 summary: commitA
807
807
808
808
809 Check bundle behavior:
809 Check bundle behavior:
810
810
811 $ hg bundle -r 'desc(mergeCD)' --base 'desc(commitC)' ../issue4736.hg
811 $ hg bundle -r 'desc(mergeCD)' --base 'desc(commitC)' ../issue4736.hg
812 2 changesets found
812 2 changesets found
813 $ hg log -r 'bundle()' -R ../issue4736.hg
813 $ hg log -r 'bundle()' -R ../issue4736.hg
814 changeset: 3:6625a5168474
814 changeset: 3:6625a5168474
815 parent: 1:eca11cf91c71
815 parent: 1:eca11cf91c71
816 user: test
816 user: test
817 date: Thu Jan 01 00:00:00 1970 +0000
817 date: Thu Jan 01 00:00:00 1970 +0000
818 summary: commitD
818 summary: commitD
819
819
820 changeset: 4:d8db9d137221
820 changeset: 4:d8db9d137221
821 tag: tip
821 tag: tip
822 parent: 2:5c51d8d6557d
822 parent: 2:5c51d8d6557d
823 parent: 3:6625a5168474
823 parent: 3:6625a5168474
824 user: test
824 user: test
825 date: Thu Jan 01 00:00:00 1970 +0000
825 date: Thu Jan 01 00:00:00 1970 +0000
826 summary: mergeCD
826 summary: mergeCD
827
827
828
828
829 check strip behavior
829 check strip behavior
830
830
831 $ hg --config extensions.strip= strip 'desc(commitD)' --debug
831 $ hg --config extensions.strip= strip 'desc(commitD)' --debug
832 resolving manifests
832 resolving manifests
833 branchmerge: False, force: True, partial: False
833 branchmerge: False, force: True, partial: False
834 ancestor: d8db9d137221+, local: d8db9d137221+, remote: eca11cf91c71
834 ancestor: d8db9d137221+, local: d8db9d137221+, remote: eca11cf91c71
835 c: other deleted -> r
835 c: other deleted -> r
836 removing c
836 removing c
837 d: other deleted -> r
837 d: other deleted -> r
838 removing d
838 removing d
839 starting 4 threads for background file closing (?)
839 starting 4 threads for background file closing (?)
840 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
840 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
841 2 changesets found
841 2 changesets found
842 list of changesets:
842 list of changesets:
843 6625a516847449b6f0fa3737b9ba56e9f0f3032c
843 6625a516847449b6f0fa3737b9ba56e9f0f3032c
844 d8db9d1372214336d2b5570f20ee468d2c72fa8b
844 d8db9d1372214336d2b5570f20ee468d2c72fa8b
845 bundle2-output-bundle: "HG20", (1 params) 2 parts total
845 bundle2-output-bundle: "HG20", (1 params) 2 parts total
846 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
846 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
847 bundle2-output-part: "phase-heads" 24 bytes payload
847 bundle2-output-part: "phase-heads" 24 bytes payload
848 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/6625a5168474-345bb43d-backup.hg (glob)
848 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/6625a5168474-345bb43d-backup.hg (glob)
849 updating the branch cache
849 updating the branch cache
850 invalid branchheads cache (served): tip differs
850 invalid branchheads cache (served): tip differs
851 truncating cache/rbc-revs-v1 to 24
851 truncating cache/rbc-revs-v1 to 24
852 $ hg log -G
852 $ hg log -G
853 o changeset: 2:5c51d8d6557d
853 o changeset: 2:5c51d8d6557d
854 | tag: tip
854 | tag: tip
855 | user: test
855 | user: test
856 | date: Thu Jan 01 00:00:00 1970 +0000
856 | date: Thu Jan 01 00:00:00 1970 +0000
857 | summary: commitC
857 | summary: commitC
858 |
858 |
859 @ changeset: 1:eca11cf91c71
859 @ changeset: 1:eca11cf91c71
860 | user: test
860 | user: test
861 | date: Thu Jan 01 00:00:00 1970 +0000
861 | date: Thu Jan 01 00:00:00 1970 +0000
862 | summary: commitB
862 | summary: commitB
863 |
863 |
864 o changeset: 0:105141ef12d0
864 o changeset: 0:105141ef12d0
865 user: test
865 user: test
866 date: Thu Jan 01 00:00:00 1970 +0000
866 date: Thu Jan 01 00:00:00 1970 +0000
867 summary: commitA
867 summary: commitA
868
868
869
869
870 strip backup content
870 strip backup content
871
871
872 $ hg log -r 'bundle()' -R .hg/strip-backup/6625a5168474-*-backup.hg
872 $ hg log -r 'bundle()' -R .hg/strip-backup/6625a5168474-*-backup.hg
873 changeset: 3:6625a5168474
873 changeset: 3:6625a5168474
874 parent: 1:eca11cf91c71
874 parent: 1:eca11cf91c71
875 user: test
875 user: test
876 date: Thu Jan 01 00:00:00 1970 +0000
876 date: Thu Jan 01 00:00:00 1970 +0000
877 summary: commitD
877 summary: commitD
878
878
879 changeset: 4:d8db9d137221
879 changeset: 4:d8db9d137221
880 tag: tip
880 tag: tip
881 parent: 2:5c51d8d6557d
881 parent: 2:5c51d8d6557d
882 parent: 3:6625a5168474
882 parent: 3:6625a5168474
883 user: test
883 user: test
884 date: Thu Jan 01 00:00:00 1970 +0000
884 date: Thu Jan 01 00:00:00 1970 +0000
885 summary: mergeCD
885 summary: mergeCD
886
886
887 Check that the phase cache is properly invalidated after a strip with bookmark.
887 Check that the phase cache is properly invalidated after a strip with bookmark.
888
888
889 $ cat > ../stripstalephasecache.py << EOF
889 $ cat > ../stripstalephasecache.py << EOF
890 > from mercurial import extensions, localrepo
890 > from mercurial import extensions, localrepo
891 > def transactioncallback(orig, repo, desc, *args, **kwargs):
891 > def transactioncallback(orig, repo, desc, *args, **kwargs):
892 > def test(transaction):
892 > def test(transaction):
893 > # observe cache inconsistency
893 > # observe cache inconsistency
894 > try:
894 > try:
895 > [repo.changelog.node(r) for r in repo.revs("not public()")]
895 > [repo.changelog.node(r) for r in repo.revs("not public()")]
896 > except IndexError:
896 > except IndexError:
897 > repo.ui.status("Index error!\n")
897 > repo.ui.status("Index error!\n")
898 > transaction = orig(repo, desc, *args, **kwargs)
898 > transaction = orig(repo, desc, *args, **kwargs)
899 > # warm up the phase cache
899 > # warm up the phase cache
900 > list(repo.revs("not public()"))
900 > list(repo.revs("not public()"))
901 > if desc != 'strip':
901 > if desc != 'strip':
902 > transaction.addpostclose("phase invalidation test", test)
902 > transaction.addpostclose("phase invalidation test", test)
903 > return transaction
903 > return transaction
904 > def extsetup(ui):
904 > def extsetup(ui):
905 > extensions.wrapfunction(localrepo.localrepository, "transaction",
905 > extensions.wrapfunction(localrepo.localrepository, "transaction",
906 > transactioncallback)
906 > transactioncallback)
907 > EOF
907 > EOF
908 $ hg up -C 2
908 $ hg up -C 2
909 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
909 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
910 $ echo k > k
910 $ echo k > k
911 $ hg add k
911 $ hg add k
912 $ hg commit -m commitK
912 $ hg commit -m commitK
913 $ echo l > l
913 $ echo l > l
914 $ hg add l
914 $ hg add l
915 $ hg commit -m commitL
915 $ hg commit -m commitL
916 $ hg book -r tip blah
916 $ hg book -r tip blah
917 $ hg strip ".^" --config extensions.crash=$TESTTMP/stripstalephasecache.py
917 $ hg strip ".^" --config extensions.crash=$TESTTMP/stripstalephasecache.py
918 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
918 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
919 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/8f0b4384875c-4fa10deb-backup.hg (glob)
919 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/8f0b4384875c-4fa10deb-backup.hg (glob)
920 $ hg up -C 1
920 $ hg up -C 1
921 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
921 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
922
922
923 Error during post-close callback of the strip transaction
923 Error during post-close callback of the strip transaction
924 (They should be gracefully handled and reported)
924 (They should be gracefully handled and reported)
925
925
926 $ cat > ../crashstrip.py << EOF
926 $ cat > ../crashstrip.py << EOF
927 > from mercurial import error
927 > from mercurial import error
928 > def reposetup(ui, repo):
928 > def reposetup(ui, repo):
929 > class crashstriprepo(repo.__class__):
929 > class crashstriprepo(repo.__class__):
930 > def transaction(self, desc, *args, **kwargs):
930 > def transaction(self, desc, *args, **kwargs):
931 > tr = super(crashstriprepo, self).transaction(desc, *args, **kwargs)
931 > tr = super(crashstriprepo, self).transaction(desc, *args, **kwargs)
932 > if desc == 'strip':
932 > if desc == 'strip':
933 > def crash(tra): raise error.Abort('boom')
933 > def crash(tra): raise error.Abort('boom')
934 > tr.addpostclose('crash', crash)
934 > tr.addpostclose('crash', crash)
935 > return tr
935 > return tr
936 > repo.__class__ = crashstriprepo
936 > repo.__class__ = crashstriprepo
937 > EOF
937 > EOF
938 $ hg strip tip --config extensions.crash=$TESTTMP/crashstrip.py
938 $ hg strip tip --config extensions.crash=$TESTTMP/crashstrip.py
939 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/5c51d8d6557d-70daef06-backup.hg (glob)
939 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/5c51d8d6557d-70daef06-backup.hg (glob)
940 strip failed, backup bundle stored in '$TESTTMP/issue4736/.hg/strip-backup/5c51d8d6557d-70daef06-backup.hg' (glob)
940 strip failed, backup bundle stored in '$TESTTMP/issue4736/.hg/strip-backup/5c51d8d6557d-70daef06-backup.hg' (glob)
941 abort: boom
941 abort: boom
942 [255]
942 [255]
943
943
944 Use delayedstrip to strip inside a transaction
944 Use delayedstrip to strip inside a transaction
945
945
946 $ cd $TESTTMP
946 $ cd $TESTTMP
947 $ hg init delayedstrip
947 $ hg init delayedstrip
948 $ cd delayedstrip
948 $ cd delayedstrip
949 $ hg debugdrawdag <<'EOS'
949 $ hg debugdrawdag <<'EOS'
950 > D
950 > D
951 > |
951 > |
952 > C F H # Commit on top of "I",
952 > C F H # Commit on top of "I",
953 > | |/| # Strip B+D+I+E+G+H+Z
953 > | |/| # Strip B+D+I+E+G+H+Z
954 > I B E G
954 > I B E G
955 > \|/
955 > \|/
956 > A Z
956 > A Z
957 > EOS
957 > EOS
958 $ cp -R . ../scmutilcleanup
958 $ cp -R . ../scmutilcleanup
959
959
960 $ hg up -C I
960 $ hg up -C I
961 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
961 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
962 $ echo 3 >> I
962 $ echo 3 >> I
963 $ cat > $TESTTMP/delayedstrip.py <<EOF
963 $ cat > $TESTTMP/delayedstrip.py <<EOF
964 > from mercurial import repair, commands
964 > from mercurial import repair, commands
965 > def reposetup(ui, repo):
965 > def reposetup(ui, repo):
966 > def getnodes(expr):
966 > def getnodes(expr):
967 > return [repo.changelog.node(r) for r in repo.revs(expr)]
967 > return [repo.changelog.node(r) for r in repo.revs(expr)]
968 > with repo.wlock():
968 > with repo.wlock():
969 > with repo.lock():
969 > with repo.lock():
970 > with repo.transaction('delayedstrip'):
970 > with repo.transaction('delayedstrip'):
971 > repair.delayedstrip(ui, repo, getnodes('B+I+Z+D+E'), 'J')
971 > repair.delayedstrip(ui, repo, getnodes('B+I+Z+D+E'), 'J')
972 > repair.delayedstrip(ui, repo, getnodes('G+H+Z'), 'I')
972 > repair.delayedstrip(ui, repo, getnodes('G+H+Z'), 'I')
973 > commands.commit(ui, repo, message='J', date='0 0')
973 > commands.commit(ui, repo, message='J', date='0 0')
974 > EOF
974 > EOF
975 $ hg log -r . -T '\n' --config extensions.t=$TESTTMP/delayedstrip.py
975 $ hg log -r . -T '\n' --config extensions.t=$TESTTMP/delayedstrip.py
976 warning: orphaned descendants detected, not stripping 08ebfeb61bac, 112478962961, 7fb047a69f22
976 warning: orphaned descendants detected, not stripping 08ebfeb61bac, 112478962961, 7fb047a69f22
977 saved backup bundle to $TESTTMP/delayedstrip/.hg/strip-backup/f585351a92f8-17475721-I.hg (glob)
977 saved backup bundle to $TESTTMP/delayedstrip/.hg/strip-backup/f585351a92f8-17475721-I.hg (glob)
978
978
979 $ hg log -G -T '{rev}:{node|short} {desc}' -r 'sort(all(), topo)'
979 $ hg log -G -T '{rev}:{node|short} {desc}' -r 'sort(all(), topo)'
980 @ 6:2f2d51af6205 J
980 @ 6:2f2d51af6205 J
981 |
981 |
982 o 3:08ebfeb61bac I
982 o 3:08ebfeb61bac I
983 |
983 |
984 | o 5:64a8289d2492 F
984 | o 5:64a8289d2492 F
985 | |
985 | |
986 | o 2:7fb047a69f22 E
986 | o 2:7fb047a69f22 E
987 |/
987 |/
988 | o 4:26805aba1e60 C
988 | o 4:26805aba1e60 C
989 | |
989 | |
990 | o 1:112478962961 B
990 | o 1:112478962961 B
991 |/
991 |/
992 o 0:426bada5c675 A
992 o 0:426bada5c675 A
993
993
994 Test high-level scmutil.cleanupnodes API
994 Test high-level scmutil.cleanupnodes API
995
995
996 $ cd $TESTTMP/scmutilcleanup
996 $ cd $TESTTMP/scmutilcleanup
997 $ hg debugdrawdag <<'EOS'
997 $ hg debugdrawdag <<'EOS'
998 > D2 F2 G2 # D2, F2, G2 are replacements for D, F, G
998 > D2 F2 G2 # D2, F2, G2 are replacements for D, F, G
999 > | | |
999 > | | |
1000 > C H G
1000 > C H G
1001 > EOS
1001 > EOS
1002 $ for i in B C D F G I Z; do
1002 $ for i in B C D F G I Z; do
1003 > hg bookmark -i -r $i b-$i
1003 > hg bookmark -i -r $i b-$i
1004 > done
1004 > done
1005 $ hg bookmark -i -r E 'b-F@divergent1'
1005 $ hg bookmark -i -r E 'b-F@divergent1'
1006 $ hg bookmark -i -r H 'b-F@divergent2'
1006 $ hg bookmark -i -r H 'b-F@divergent2'
1007 $ hg bookmark -i -r G 'b-F@divergent3'
1007 $ hg bookmark -i -r G 'b-F@divergent3'
1008 $ cp -R . ../scmutilcleanup.obsstore
1008 $ cp -R . ../scmutilcleanup.obsstore
1009
1009
1010 $ cat > $TESTTMP/scmutilcleanup.py <<EOF
1010 $ cat > $TESTTMP/scmutilcleanup.py <<EOF
1011 > from mercurial import scmutil
1011 > from mercurial import scmutil
1012 > def reposetup(ui, repo):
1012 > def reposetup(ui, repo):
1013 > def nodes(expr):
1013 > def nodes(expr):
1014 > return [repo.changelog.node(r) for r in repo.revs(expr)]
1014 > return [repo.changelog.node(r) for r in repo.revs(expr)]
1015 > def node(expr):
1015 > def node(expr):
1016 > return nodes(expr)[0]
1016 > return nodes(expr)[0]
1017 > with repo.wlock():
1017 > with repo.wlock():
1018 > with repo.lock():
1018 > with repo.lock():
1019 > with repo.transaction('delayedstrip'):
1019 > with repo.transaction('delayedstrip'):
1020 > mapping = {node('F'): [node('F2')],
1020 > mapping = {node('F'): [node('F2')],
1021 > node('D'): [node('D2')],
1021 > node('D'): [node('D2')],
1022 > node('G'): [node('G2')]}
1022 > node('G'): [node('G2')]}
1023 > scmutil.cleanupnodes(repo, mapping, 'replace')
1023 > scmutil.cleanupnodes(repo, mapping, 'replace')
1024 > scmutil.cleanupnodes(repo, nodes('((B::)+I+Z)-D2'), 'replace')
1024 > scmutil.cleanupnodes(repo, nodes('((B::)+I+Z)-D2'), 'replace')
1025 > EOF
1025 > EOF
1026 $ hg log -r . -T '\n' --config extensions.t=$TESTTMP/scmutilcleanup.py
1026 $ hg log -r . -T '\n' --config extensions.t=$TESTTMP/scmutilcleanup.py
1027 warning: orphaned descendants detected, not stripping 112478962961, 1fc8102cda62, 26805aba1e60
1027 warning: orphaned descendants detected, not stripping 112478962961, 1fc8102cda62, 26805aba1e60
1028 saved backup bundle to $TESTTMP/scmutilcleanup/.hg/strip-backup/f585351a92f8-73fb7c03-replace.hg (glob)
1028 saved backup bundle to $TESTTMP/scmutilcleanup/.hg/strip-backup/f585351a92f8-73fb7c03-replace.hg (glob)
1029
1029
1030 $ hg log -G -T '{rev}:{node|short} {desc} {bookmarks}' -r 'sort(all(), topo)'
1030 $ hg log -G -T '{rev}:{node|short} {desc} {bookmarks}' -r 'sort(all(), topo)'
1031 o 8:1473d4b996d1 G2 b-F@divergent3 b-G
1031 o 8:1473d4b996d1 G2 b-F@divergent3 b-G
1032 |
1032 |
1033 | o 7:d11b3456a873 F2 b-F
1033 | o 7:d11b3456a873 F2 b-F
1034 | |
1034 | |
1035 | o 5:5cb05ba470a7 H
1035 | o 5:5cb05ba470a7 H
1036 |/|
1036 |/|
1037 | o 3:7fb047a69f22 E b-F@divergent1
1037 | o 3:7fb047a69f22 E b-F@divergent1
1038 | |
1038 | |
1039 | | o 6:7c78f703e465 D2 b-D
1039 | | o 6:7c78f703e465 D2 b-D
1040 | | |
1040 | | |
1041 | | o 4:26805aba1e60 C
1041 | | o 4:26805aba1e60 C
1042 | | |
1042 | | |
1043 | | o 2:112478962961 B
1043 | | o 2:112478962961 B
1044 | |/
1044 | |/
1045 o | 1:1fc8102cda62 G
1045 o | 1:1fc8102cda62 G
1046 /
1046 /
1047 o 0:426bada5c675 A b-B b-C b-I
1047 o 0:426bada5c675 A b-B b-C b-I
1048
1048
1049 $ hg bookmark
1049 $ hg bookmark
1050 b-B 0:426bada5c675
1050 b-B 0:426bada5c675
1051 b-C 0:426bada5c675
1051 b-C 0:426bada5c675
1052 b-D 6:7c78f703e465
1052 b-D 6:7c78f703e465
1053 b-F 7:d11b3456a873
1053 b-F 7:d11b3456a873
1054 b-F@divergent1 3:7fb047a69f22
1054 b-F@divergent1 3:7fb047a69f22
1055 b-F@divergent3 8:1473d4b996d1
1055 b-F@divergent3 8:1473d4b996d1
1056 b-G 8:1473d4b996d1
1056 b-G 8:1473d4b996d1
1057 b-I 0:426bada5c675
1057 b-I 0:426bada5c675
1058 b-Z -1:000000000000
1058 b-Z -1:000000000000
1059
1059
1060 Test the above using obsstore "by the way". Not directly related to strip, but
1060 Test the above using obsstore "by the way". Not directly related to strip, but
1061 we have reusable code here
1061 we have reusable code here
1062
1062
1063 $ cd $TESTTMP/scmutilcleanup.obsstore
1063 $ cd $TESTTMP/scmutilcleanup.obsstore
1064 $ cat >> .hg/hgrc <<EOF
1064 $ cat >> .hg/hgrc <<EOF
1065 > [experimental]
1065 > [experimental]
1066 > evolution=all
1066 > evolution=all
1067 > evolution.track-operation=1
1067 > evolution.track-operation=1
1068 > EOF
1068 > EOF
1069
1069
1070 $ hg log -r . -T '\n' --config extensions.t=$TESTTMP/scmutilcleanup.py
1070 $ hg log -r . -T '\n' --config extensions.t=$TESTTMP/scmutilcleanup.py
1071
1071
1072 $ rm .hg/localtags
1072 $ rm .hg/localtags
1073 $ hg log -G -T '{rev}:{node|short} {desc} {bookmarks}' -r 'sort(all(), topo)'
1073 $ hg log -G -T '{rev}:{node|short} {desc} {bookmarks}' -r 'sort(all(), topo)'
1074 o 12:1473d4b996d1 G2 b-F@divergent3 b-G
1074 o 12:1473d4b996d1 G2 b-F@divergent3 b-G
1075 |
1075 |
1076 | o 11:d11b3456a873 F2 b-F
1076 | o 11:d11b3456a873 F2 b-F
1077 | |
1077 | |
1078 | o 8:5cb05ba470a7 H
1078 | o 8:5cb05ba470a7 H
1079 |/|
1079 |/|
1080 | o 4:7fb047a69f22 E b-F@divergent1
1080 | o 4:7fb047a69f22 E b-F@divergent1
1081 | |
1081 | |
1082 | | o 10:7c78f703e465 D2 b-D
1082 | | o 10:7c78f703e465 D2 b-D
1083 | | |
1083 | | |
1084 | | x 6:26805aba1e60 C
1084 | | x 6:26805aba1e60 C
1085 | | |
1085 | | |
1086 | | x 3:112478962961 B
1086 | | x 3:112478962961 B
1087 | |/
1087 | |/
1088 x | 1:1fc8102cda62 G
1088 x | 1:1fc8102cda62 G
1089 /
1089 /
1090 o 0:426bada5c675 A b-B b-C b-I
1090 o 0:426bada5c675 A b-B b-C b-I
1091
1091
1092 $ hg debugobsolete
1092 $ hg debugobsolete
1093 1fc8102cda6204549f031015641606ccf5513ec3 1473d4b996d1d1b121de6b39fab6a04fbf9d873e 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'replace', 'user': 'test'}
1093 1fc8102cda6204549f031015641606ccf5513ec3 1473d4b996d1d1b121de6b39fab6a04fbf9d873e 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'replace', 'user': 'test'}
1094 64a8289d249234b9886244d379f15e6b650b28e3 d11b3456a873daec7c7bc53e5622e8df6d741bd2 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'replace', 'user': 'test'}
1094 64a8289d249234b9886244d379f15e6b650b28e3 d11b3456a873daec7c7bc53e5622e8df6d741bd2 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'replace', 'user': 'test'}
1095 f585351a92f85104bff7c284233c338b10eb1df7 7c78f703e465d73102cc8780667ce269c5208a40 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'replace', 'user': 'test'}
1095 f585351a92f85104bff7c284233c338b10eb1df7 7c78f703e465d73102cc8780667ce269c5208a40 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'replace', 'user': 'test'}
1096 48b9aae0607f43ff110d84e6883c151942add5ab 0 {0000000000000000000000000000000000000000} (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'replace', 'user': 'test'}
1096 48b9aae0607f43ff110d84e6883c151942add5ab 0 {0000000000000000000000000000000000000000} (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'replace', 'user': 'test'}
1097 112478962961147124edd43549aedd1a335e44bf 0 {426bada5c67598ca65036d57d9e4b64b0c1ce7a0} (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'replace', 'user': 'test'}
1097 112478962961147124edd43549aedd1a335e44bf 0 {426bada5c67598ca65036d57d9e4b64b0c1ce7a0} (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'replace', 'user': 'test'}
1098 08ebfeb61bac6e3f12079de774d285a0d6689eba 0 {426bada5c67598ca65036d57d9e4b64b0c1ce7a0} (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'replace', 'user': 'test'}
1098 08ebfeb61bac6e3f12079de774d285a0d6689eba 0 {426bada5c67598ca65036d57d9e4b64b0c1ce7a0} (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'replace', 'user': 'test'}
1099 26805aba1e600a82e93661149f2313866a221a7b 0 {112478962961147124edd43549aedd1a335e44bf} (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'replace', 'user': 'test'}
1099 26805aba1e600a82e93661149f2313866a221a7b 0 {112478962961147124edd43549aedd1a335e44bf} (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'replace', 'user': 'test'}
1100 $ cd ..
1101
1102 Test that obsmarkers are restored even when not using generaldelta
1103
1104 $ hg --config format.usegeneraldelta=no init issue5678
1105 $ cd issue5678
1106 $ cat >> .hg/hgrc <<EOF
1107 > [experimental]
1108 > evolution=all
1109 > EOF
1110 $ echo a > a
1111 $ hg ci -Aqm a
1112 $ hg ci --amend -m a2
1113 $ hg debugobsolete
1114 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b 489bac576828490c0bb8d45eac9e5e172e4ec0a8 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1115 $ hg strip .
1116 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1117 saved backup bundle to $TESTTMP/issue5678/.hg/strip-backup/489bac576828-bef27e14-backup.hg (glob)
1118 $ hg unbundle -q .hg/strip-backup/*
1119 BROKEN: obsmarker got lost
1120 $ hg debugobsolete
1121 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now