##// END OF EJS Templates
tests: stabilize on Windows...
Matt Harbison -
r33337:de324547 default
parent child Browse files
Show More
@@ -1,955 +1,955 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 Test for revset
378 Test for revset
379
379
380 We need a bit different graph
380 We need a bit different graph
381 All destination are B
381 All destination are B
382
382
383 $ hg init ah
383 $ hg init ah
384 $ cd ah
384 $ cd ah
385 $ hg unbundle "$TESTDIR/bundles/rebase-revset.hg"
385 $ hg unbundle "$TESTDIR/bundles/rebase-revset.hg"
386 adding changesets
386 adding changesets
387 adding manifests
387 adding manifests
388 adding file changes
388 adding file changes
389 added 9 changesets with 9 changes to 9 files (+2 heads)
389 added 9 changesets with 9 changes to 9 files (+2 heads)
390 (run 'hg heads' to see heads, 'hg merge' to merge)
390 (run 'hg heads' to see heads, 'hg merge' to merge)
391 $ hg tglog
391 $ hg tglog
392 o 8: 'I'
392 o 8: 'I'
393 |
393 |
394 o 7: 'H'
394 o 7: 'H'
395 |
395 |
396 o 6: 'G'
396 o 6: 'G'
397 |
397 |
398 | o 5: 'F'
398 | o 5: 'F'
399 | |
399 | |
400 | o 4: 'E'
400 | o 4: 'E'
401 |/
401 |/
402 o 3: 'D'
402 o 3: 'D'
403 |
403 |
404 o 2: 'C'
404 o 2: 'C'
405 |
405 |
406 | o 1: 'B'
406 | o 1: 'B'
407 |/
407 |/
408 o 0: 'A'
408 o 0: 'A'
409
409
410 $ cd ..
410 $ cd ..
411
411
412
412
413 Simple case with keep:
413 Simple case with keep:
414
414
415 Source on have two descendant heads but ask for one
415 Source on have two descendant heads but ask for one
416
416
417 $ hg clone -q -u . ah ah1
417 $ hg clone -q -u . ah ah1
418 $ cd ah1
418 $ cd ah1
419 $ hg rebase -r '2::8' -d 1
419 $ hg rebase -r '2::8' -d 1
420 abort: can't remove original changesets with unrebased descendants
420 abort: can't remove original changesets with unrebased descendants
421 (use --keep to keep original changesets)
421 (use --keep to keep original changesets)
422 [255]
422 [255]
423 $ hg rebase -r '2::8' -d 1 -k
423 $ hg rebase -r '2::8' -d 1 -k
424 rebasing 2:c9e50f6cdc55 "C"
424 rebasing 2:c9e50f6cdc55 "C"
425 rebasing 3:ffd453c31098 "D"
425 rebasing 3:ffd453c31098 "D"
426 rebasing 6:3d8a618087a7 "G"
426 rebasing 6:3d8a618087a7 "G"
427 rebasing 7:72434a4e60b0 "H"
427 rebasing 7:72434a4e60b0 "H"
428 rebasing 8:479ddb54a924 "I" (tip)
428 rebasing 8:479ddb54a924 "I" (tip)
429 $ hg tglog
429 $ hg tglog
430 o 13: 'I'
430 o 13: 'I'
431 |
431 |
432 o 12: 'H'
432 o 12: 'H'
433 |
433 |
434 o 11: 'G'
434 o 11: 'G'
435 |
435 |
436 o 10: 'D'
436 o 10: 'D'
437 |
437 |
438 o 9: 'C'
438 o 9: 'C'
439 |
439 |
440 | o 8: 'I'
440 | o 8: 'I'
441 | |
441 | |
442 | o 7: 'H'
442 | o 7: 'H'
443 | |
443 | |
444 | o 6: 'G'
444 | o 6: 'G'
445 | |
445 | |
446 | | o 5: 'F'
446 | | o 5: 'F'
447 | | |
447 | | |
448 | | o 4: 'E'
448 | | o 4: 'E'
449 | |/
449 | |/
450 | o 3: 'D'
450 | o 3: 'D'
451 | |
451 | |
452 | o 2: 'C'
452 | o 2: 'C'
453 | |
453 | |
454 o | 1: 'B'
454 o | 1: 'B'
455 |/
455 |/
456 o 0: 'A'
456 o 0: 'A'
457
457
458
458
459 $ cd ..
459 $ cd ..
460
460
461 Base on have one descendant heads we ask for but common ancestor have two
461 Base on have one descendant heads we ask for but common ancestor have two
462
462
463 $ hg clone -q -u . ah ah2
463 $ hg clone -q -u . ah ah2
464 $ cd ah2
464 $ cd ah2
465 $ hg rebase -r '3::8' -d 1
465 $ hg rebase -r '3::8' -d 1
466 abort: can't remove original changesets with unrebased descendants
466 abort: can't remove original changesets with unrebased descendants
467 (use --keep to keep original changesets)
467 (use --keep to keep original changesets)
468 [255]
468 [255]
469 $ hg rebase -r '3::8' -d 1 --keep
469 $ hg rebase -r '3::8' -d 1 --keep
470 rebasing 3:ffd453c31098 "D"
470 rebasing 3:ffd453c31098 "D"
471 rebasing 6:3d8a618087a7 "G"
471 rebasing 6:3d8a618087a7 "G"
472 rebasing 7:72434a4e60b0 "H"
472 rebasing 7:72434a4e60b0 "H"
473 rebasing 8:479ddb54a924 "I" (tip)
473 rebasing 8:479ddb54a924 "I" (tip)
474 $ hg tglog
474 $ hg tglog
475 o 12: 'I'
475 o 12: 'I'
476 |
476 |
477 o 11: 'H'
477 o 11: 'H'
478 |
478 |
479 o 10: 'G'
479 o 10: 'G'
480 |
480 |
481 o 9: 'D'
481 o 9: 'D'
482 |
482 |
483 | o 8: 'I'
483 | o 8: 'I'
484 | |
484 | |
485 | o 7: 'H'
485 | o 7: 'H'
486 | |
486 | |
487 | o 6: 'G'
487 | o 6: 'G'
488 | |
488 | |
489 | | o 5: 'F'
489 | | o 5: 'F'
490 | | |
490 | | |
491 | | o 4: 'E'
491 | | o 4: 'E'
492 | |/
492 | |/
493 | o 3: 'D'
493 | o 3: 'D'
494 | |
494 | |
495 | o 2: 'C'
495 | o 2: 'C'
496 | |
496 | |
497 o | 1: 'B'
497 o | 1: 'B'
498 |/
498 |/
499 o 0: 'A'
499 o 0: 'A'
500
500
501
501
502 $ cd ..
502 $ cd ..
503
503
504 rebase subset
504 rebase subset
505
505
506 $ hg clone -q -u . ah ah3
506 $ hg clone -q -u . ah ah3
507 $ cd ah3
507 $ cd ah3
508 $ hg rebase -r '3::7' -d 1
508 $ hg rebase -r '3::7' -d 1
509 abort: can't remove original changesets with unrebased descendants
509 abort: can't remove original changesets with unrebased descendants
510 (use --keep to keep original changesets)
510 (use --keep to keep original changesets)
511 [255]
511 [255]
512 $ hg rebase -r '3::7' -d 1 --keep
512 $ hg rebase -r '3::7' -d 1 --keep
513 rebasing 3:ffd453c31098 "D"
513 rebasing 3:ffd453c31098 "D"
514 rebasing 6:3d8a618087a7 "G"
514 rebasing 6:3d8a618087a7 "G"
515 rebasing 7:72434a4e60b0 "H"
515 rebasing 7:72434a4e60b0 "H"
516 $ hg tglog
516 $ hg tglog
517 o 11: 'H'
517 o 11: 'H'
518 |
518 |
519 o 10: 'G'
519 o 10: 'G'
520 |
520 |
521 o 9: 'D'
521 o 9: 'D'
522 |
522 |
523 | o 8: 'I'
523 | o 8: 'I'
524 | |
524 | |
525 | o 7: 'H'
525 | o 7: 'H'
526 | |
526 | |
527 | o 6: 'G'
527 | o 6: 'G'
528 | |
528 | |
529 | | o 5: 'F'
529 | | o 5: 'F'
530 | | |
530 | | |
531 | | o 4: 'E'
531 | | o 4: 'E'
532 | |/
532 | |/
533 | o 3: 'D'
533 | o 3: 'D'
534 | |
534 | |
535 | o 2: 'C'
535 | o 2: 'C'
536 | |
536 | |
537 o | 1: 'B'
537 o | 1: 'B'
538 |/
538 |/
539 o 0: 'A'
539 o 0: 'A'
540
540
541
541
542 $ cd ..
542 $ cd ..
543
543
544 rebase subset with multiple head
544 rebase subset with multiple head
545
545
546 $ hg clone -q -u . ah ah4
546 $ hg clone -q -u . ah ah4
547 $ cd ah4
547 $ cd ah4
548 $ hg rebase -r '3::(7+5)' -d 1
548 $ hg rebase -r '3::(7+5)' -d 1
549 abort: can't remove original changesets with unrebased descendants
549 abort: can't remove original changesets with unrebased descendants
550 (use --keep to keep original changesets)
550 (use --keep to keep original changesets)
551 [255]
551 [255]
552 $ hg rebase -r '3::(7+5)' -d 1 --keep
552 $ hg rebase -r '3::(7+5)' -d 1 --keep
553 rebasing 3:ffd453c31098 "D"
553 rebasing 3:ffd453c31098 "D"
554 rebasing 4:c01897464e7f "E"
554 rebasing 4:c01897464e7f "E"
555 rebasing 5:41bfcc75ed73 "F"
555 rebasing 5:41bfcc75ed73 "F"
556 rebasing 6:3d8a618087a7 "G"
556 rebasing 6:3d8a618087a7 "G"
557 rebasing 7:72434a4e60b0 "H"
557 rebasing 7:72434a4e60b0 "H"
558 $ hg tglog
558 $ hg tglog
559 o 13: 'H'
559 o 13: 'H'
560 |
560 |
561 o 12: 'G'
561 o 12: 'G'
562 |
562 |
563 | o 11: 'F'
563 | o 11: 'F'
564 | |
564 | |
565 | o 10: 'E'
565 | o 10: 'E'
566 |/
566 |/
567 o 9: 'D'
567 o 9: 'D'
568 |
568 |
569 | o 8: 'I'
569 | o 8: 'I'
570 | |
570 | |
571 | o 7: 'H'
571 | o 7: 'H'
572 | |
572 | |
573 | o 6: 'G'
573 | o 6: 'G'
574 | |
574 | |
575 | | o 5: 'F'
575 | | o 5: 'F'
576 | | |
576 | | |
577 | | o 4: 'E'
577 | | o 4: 'E'
578 | |/
578 | |/
579 | o 3: 'D'
579 | o 3: 'D'
580 | |
580 | |
581 | o 2: 'C'
581 | o 2: 'C'
582 | |
582 | |
583 o | 1: 'B'
583 o | 1: 'B'
584 |/
584 |/
585 o 0: 'A'
585 o 0: 'A'
586
586
587
587
588 $ cd ..
588 $ cd ..
589
589
590 More advanced tests
590 More advanced tests
591
591
592 rebase on ancestor with revset
592 rebase on ancestor with revset
593
593
594 $ hg clone -q -u . ah ah5
594 $ hg clone -q -u . ah ah5
595 $ cd ah5
595 $ cd ah5
596 $ hg rebase -r '6::' -d 2
596 $ hg rebase -r '6::' -d 2
597 rebasing 6:3d8a618087a7 "G"
597 rebasing 6:3d8a618087a7 "G"
598 rebasing 7:72434a4e60b0 "H"
598 rebasing 7:72434a4e60b0 "H"
599 rebasing 8:479ddb54a924 "I" (tip)
599 rebasing 8:479ddb54a924 "I" (tip)
600 saved backup bundle to $TESTTMP/ah5/.hg/strip-backup/3d8a618087a7-b4f73f31-rebase.hg (glob)
600 saved backup bundle to $TESTTMP/ah5/.hg/strip-backup/3d8a618087a7-b4f73f31-rebase.hg (glob)
601 $ hg tglog
601 $ hg tglog
602 o 8: 'I'
602 o 8: 'I'
603 |
603 |
604 o 7: 'H'
604 o 7: 'H'
605 |
605 |
606 o 6: 'G'
606 o 6: 'G'
607 |
607 |
608 | o 5: 'F'
608 | o 5: 'F'
609 | |
609 | |
610 | o 4: 'E'
610 | o 4: 'E'
611 | |
611 | |
612 | o 3: 'D'
612 | o 3: 'D'
613 |/
613 |/
614 o 2: 'C'
614 o 2: 'C'
615 |
615 |
616 | o 1: 'B'
616 | o 1: 'B'
617 |/
617 |/
618 o 0: 'A'
618 o 0: 'A'
619
619
620 $ cd ..
620 $ cd ..
621
621
622
622
623 rebase with multiple root.
623 rebase with multiple root.
624 We rebase E and G on B
624 We rebase E and G on B
625 We would expect heads are I, F if it was supported
625 We would expect heads are I, F if it was supported
626
626
627 $ hg clone -q -u . ah ah6
627 $ hg clone -q -u . ah ah6
628 $ cd ah6
628 $ cd ah6
629 $ hg rebase -r '(4+6)::' -d 1
629 $ hg rebase -r '(4+6)::' -d 1
630 rebasing 4:c01897464e7f "E"
630 rebasing 4:c01897464e7f "E"
631 rebasing 5:41bfcc75ed73 "F"
631 rebasing 5:41bfcc75ed73 "F"
632 rebasing 6:3d8a618087a7 "G"
632 rebasing 6:3d8a618087a7 "G"
633 rebasing 7:72434a4e60b0 "H"
633 rebasing 7:72434a4e60b0 "H"
634 rebasing 8:479ddb54a924 "I" (tip)
634 rebasing 8:479ddb54a924 "I" (tip)
635 saved backup bundle to $TESTTMP/ah6/.hg/strip-backup/3d8a618087a7-aae93a24-rebase.hg (glob)
635 saved backup bundle to $TESTTMP/ah6/.hg/strip-backup/3d8a618087a7-aae93a24-rebase.hg (glob)
636 $ hg tglog
636 $ hg tglog
637 o 8: 'I'
637 o 8: 'I'
638 |
638 |
639 o 7: 'H'
639 o 7: 'H'
640 |
640 |
641 o 6: 'G'
641 o 6: 'G'
642 |
642 |
643 | o 5: 'F'
643 | o 5: 'F'
644 | |
644 | |
645 | o 4: 'E'
645 | o 4: 'E'
646 |/
646 |/
647 | o 3: 'D'
647 | o 3: 'D'
648 | |
648 | |
649 | o 2: 'C'
649 | o 2: 'C'
650 | |
650 | |
651 o | 1: 'B'
651 o | 1: 'B'
652 |/
652 |/
653 o 0: 'A'
653 o 0: 'A'
654
654
655 $ cd ..
655 $ cd ..
656
656
657 More complex rebase with multiple roots
657 More complex rebase with multiple roots
658 each root have a different common ancestor with the destination and this is a detach
658 each root have a different common ancestor with the destination and this is a detach
659
659
660 (setup)
660 (setup)
661
661
662 $ hg clone -q -u . a a8
662 $ hg clone -q -u . a a8
663 $ cd a8
663 $ cd a8
664 $ echo I > I
664 $ echo I > I
665 $ hg add I
665 $ hg add I
666 $ hg commit -m I
666 $ hg commit -m I
667 $ hg up 4
667 $ hg up 4
668 1 files updated, 0 files merged, 3 files removed, 0 files unresolved
668 1 files updated, 0 files merged, 3 files removed, 0 files unresolved
669 $ echo I > J
669 $ echo I > J
670 $ hg add J
670 $ hg add J
671 $ hg commit -m J
671 $ hg commit -m J
672 created new head
672 created new head
673 $ echo I > K
673 $ echo I > K
674 $ hg add K
674 $ hg add K
675 $ hg commit -m K
675 $ hg commit -m K
676 $ hg tglog
676 $ hg tglog
677 @ 10: 'K'
677 @ 10: 'K'
678 |
678 |
679 o 9: 'J'
679 o 9: 'J'
680 |
680 |
681 | o 8: 'I'
681 | o 8: 'I'
682 | |
682 | |
683 | o 7: 'H'
683 | o 7: 'H'
684 | |
684 | |
685 +---o 6: 'G'
685 +---o 6: 'G'
686 | |/
686 | |/
687 | o 5: 'F'
687 | o 5: 'F'
688 | |
688 | |
689 o | 4: 'E'
689 o | 4: 'E'
690 |/
690 |/
691 | o 3: 'D'
691 | o 3: 'D'
692 | |
692 | |
693 | o 2: 'C'
693 | o 2: 'C'
694 | |
694 | |
695 | o 1: 'B'
695 | o 1: 'B'
696 |/
696 |/
697 o 0: 'A'
697 o 0: 'A'
698
698
699 (actual test)
699 (actual test)
700
700
701 $ hg rebase --dest 'desc(G)' --rev 'desc(K) + desc(I)'
701 $ hg rebase --dest 'desc(G)' --rev 'desc(K) + desc(I)'
702 rebasing 8:e7ec4e813ba6 "I"
702 rebasing 8:e7ec4e813ba6 "I"
703 rebasing 10:23a4ace37988 "K" (tip)
703 rebasing 10:23a4ace37988 "K" (tip)
704 saved backup bundle to $TESTTMP/a8/.hg/strip-backup/23a4ace37988-b06984b3-rebase.hg (glob)
704 saved backup bundle to $TESTTMP/a8/.hg/strip-backup/23a4ace37988-b06984b3-rebase.hg (glob)
705 $ hg log --rev 'children(desc(G))'
705 $ hg log --rev 'children(desc(G))'
706 changeset: 9:adb617877056
706 changeset: 9:adb617877056
707 parent: 6:eea13746799a
707 parent: 6:eea13746799a
708 user: test
708 user: test
709 date: Thu Jan 01 00:00:00 1970 +0000
709 date: Thu Jan 01 00:00:00 1970 +0000
710 summary: I
710 summary: I
711
711
712 changeset: 10:882431a34a0e
712 changeset: 10:882431a34a0e
713 tag: tip
713 tag: tip
714 parent: 6:eea13746799a
714 parent: 6:eea13746799a
715 user: test
715 user: test
716 date: Thu Jan 01 00:00:00 1970 +0000
716 date: Thu Jan 01 00:00:00 1970 +0000
717 summary: K
717 summary: K
718
718
719 $ hg tglog
719 $ hg tglog
720 @ 10: 'K'
720 @ 10: 'K'
721 |
721 |
722 | o 9: 'I'
722 | o 9: 'I'
723 |/
723 |/
724 | o 8: 'J'
724 | o 8: 'J'
725 | |
725 | |
726 | | o 7: 'H'
726 | | o 7: 'H'
727 | | |
727 | | |
728 o---+ 6: 'G'
728 o---+ 6: 'G'
729 |/ /
729 |/ /
730 | o 5: 'F'
730 | o 5: 'F'
731 | |
731 | |
732 o | 4: 'E'
732 o | 4: 'E'
733 |/
733 |/
734 | o 3: 'D'
734 | o 3: 'D'
735 | |
735 | |
736 | o 2: 'C'
736 | o 2: 'C'
737 | |
737 | |
738 | o 1: 'B'
738 | o 1: 'B'
739 |/
739 |/
740 o 0: 'A'
740 o 0: 'A'
741
741
742
742
743 Test that rebase is not confused by $CWD disappearing during rebase (issue4121)
743 Test that rebase is not confused by $CWD disappearing during rebase (issue4121)
744
744
745 $ cd ..
745 $ cd ..
746 $ hg init cwd-vanish
746 $ hg init cwd-vanish
747 $ cd cwd-vanish
747 $ cd cwd-vanish
748 $ touch initial-file
748 $ touch initial-file
749 $ hg add initial-file
749 $ hg add initial-file
750 $ hg commit -m 'initial commit'
750 $ hg commit -m 'initial commit'
751 $ touch dest-file
751 $ touch dest-file
752 $ hg add dest-file
752 $ hg add dest-file
753 $ hg commit -m 'dest commit'
753 $ hg commit -m 'dest commit'
754 $ hg up 0
754 $ hg up 0
755 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
755 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
756 $ touch other-file
756 $ touch other-file
757 $ hg add other-file
757 $ hg add other-file
758 $ hg commit -m 'first source commit'
758 $ hg commit -m 'first source commit'
759 created new head
759 created new head
760 $ mkdir subdir
760 $ mkdir subdir
761 $ cd subdir
761 $ cd subdir
762 $ touch subfile
762 $ touch subfile
763 $ hg add subfile
763 $ hg add subfile
764 $ hg commit -m 'second source with subdir'
764 $ hg commit -m 'second source with subdir'
765 #if rmcwd
765 #if rmcwd
766 $ hg rebase -b . -d 1 --traceback
766 $ hg rebase -b . -d 1 --traceback
767 rebasing 2:779a07b1b7a0 "first source commit"
767 rebasing 2:779a07b1b7a0 "first source commit"
768 current directory was removed
768 current directory was removed
769 (consider changing to repo root: $TESTTMP/cwd-vanish)
769 (consider changing to repo root: $TESTTMP/cwd-vanish)
770 rebasing 3:a7d6f3a00bf3 "second source with subdir" (tip)
770 rebasing 3:a7d6f3a00bf3 "second source with subdir" (tip)
771 saved backup bundle to $TESTTMP/cwd-vanish/.hg/strip-backup/779a07b1b7a0-853e0073-rebase.hg (glob)
771 saved backup bundle to $TESTTMP/cwd-vanish/.hg/strip-backup/779a07b1b7a0-853e0073-rebase.hg (glob)
772 #else
772 #else
773 $ hg rebase -b . -d 1 --traceback
773 $ hg rebase -b . -d 1 --traceback
774 rebasing 2:779a07b1b7a0 "first source commit"
774 rebasing 2:779a07b1b7a0 "first source commit"
775 rebasing 3:a7d6f3a00bf3 "second source with subdir" (tip)
775 rebasing 3:a7d6f3a00bf3 "second source with subdir" (tip)
776 saved backup bundle to $TESTTMP/cwd-vanish/.hg/strip-backup/779a07b1b7a0-853e0073-backup.hg (glob)
776 saved backup bundle to $TESTTMP/cwd-vanish/.hg/strip-backup/779a07b1b7a0-853e0073-rebase.hg (glob)
777 #endif
777 #endif
778
778
779 Get back to the root of cwd-vanish. Note that even though `cd ..`
779 Get back to the root of cwd-vanish. Note that even though `cd ..`
780 works on most systems, it does not work on FreeBSD 10, so we use an
780 works on most systems, it does not work on FreeBSD 10, so we use an
781 absolute path to get back to the repository.
781 absolute path to get back to the repository.
782 $ cd $TESTTMP
782 $ cd $TESTTMP
783
783
784 Test that rebase is done in topo order (issue5370)
784 Test that rebase is done in topo order (issue5370)
785
785
786 $ hg init order
786 $ hg init order
787 $ cd order
787 $ cd order
788 $ touch a && hg add a && hg ci -m A
788 $ touch a && hg add a && hg ci -m A
789 $ touch b && hg add b && hg ci -m B
789 $ touch b && hg add b && hg ci -m B
790 $ touch c && hg add c && hg ci -m C
790 $ touch c && hg add c && hg ci -m C
791 $ hg up 1
791 $ hg up 1
792 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
792 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
793 $ touch d && hg add d && hg ci -m D
793 $ touch d && hg add d && hg ci -m D
794 created new head
794 created new head
795 $ hg up 2
795 $ hg up 2
796 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
796 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
797 $ touch e && hg add e && hg ci -m E
797 $ touch e && hg add e && hg ci -m E
798 $ hg up 3
798 $ hg up 3
799 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
799 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
800 $ touch f && hg add f && hg ci -m F
800 $ touch f && hg add f && hg ci -m F
801 $ hg up 0
801 $ hg up 0
802 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
802 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
803 $ touch g && hg add g && hg ci -m G
803 $ touch g && hg add g && hg ci -m G
804 created new head
804 created new head
805
805
806 $ hg tglog
806 $ hg tglog
807 @ 6: 'G'
807 @ 6: 'G'
808 |
808 |
809 | o 5: 'F'
809 | o 5: 'F'
810 | |
810 | |
811 | | o 4: 'E'
811 | | o 4: 'E'
812 | | |
812 | | |
813 | o | 3: 'D'
813 | o | 3: 'D'
814 | | |
814 | | |
815 | | o 2: 'C'
815 | | o 2: 'C'
816 | |/
816 | |/
817 | o 1: 'B'
817 | o 1: 'B'
818 |/
818 |/
819 o 0: 'A'
819 o 0: 'A'
820
820
821
821
822 $ hg rebase -s 1 -d 6
822 $ hg rebase -s 1 -d 6
823 rebasing 1:76035bbd54bd "B"
823 rebasing 1:76035bbd54bd "B"
824 rebasing 2:d84f5cfaaf14 "C"
824 rebasing 2:d84f5cfaaf14 "C"
825 rebasing 4:82ae8dc7a9b7 "E"
825 rebasing 4:82ae8dc7a9b7 "E"
826 rebasing 3:ab709c9f7171 "D"
826 rebasing 3:ab709c9f7171 "D"
827 rebasing 5:412b391de760 "F"
827 rebasing 5:412b391de760 "F"
828 saved backup bundle to $TESTTMP/order/.hg/strip-backup/76035bbd54bd-e341bc99-rebase.hg (glob)
828 saved backup bundle to $TESTTMP/order/.hg/strip-backup/76035bbd54bd-e341bc99-rebase.hg (glob)
829
829
830 $ hg tglog
830 $ hg tglog
831 o 6: 'F'
831 o 6: 'F'
832 |
832 |
833 o 5: 'D'
833 o 5: 'D'
834 |
834 |
835 | o 4: 'E'
835 | o 4: 'E'
836 | |
836 | |
837 | o 3: 'C'
837 | o 3: 'C'
838 |/
838 |/
839 o 2: 'B'
839 o 2: 'B'
840 |
840 |
841 @ 1: 'G'
841 @ 1: 'G'
842 |
842 |
843 o 0: 'A'
843 o 0: 'A'
844
844
845
845
846 Test experimental revset
846 Test experimental revset
847 ========================
847 ========================
848
848
849 $ cd ../cwd-vanish
849 $ cd ../cwd-vanish
850
850
851 Make the repo a bit more interesting
851 Make the repo a bit more interesting
852
852
853 $ hg up 1
853 $ hg up 1
854 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
854 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
855 $ echo aaa > aaa
855 $ echo aaa > aaa
856 $ hg add aaa
856 $ hg add aaa
857 $ hg commit -m aaa
857 $ hg commit -m aaa
858 created new head
858 created new head
859 $ hg log -G
859 $ hg log -G
860 @ changeset: 4:5f7bc9025ed2
860 @ changeset: 4:5f7bc9025ed2
861 | tag: tip
861 | tag: tip
862 | parent: 1:58d79cc1cf43
862 | parent: 1:58d79cc1cf43
863 | user: test
863 | user: test
864 | date: Thu Jan 01 00:00:00 1970 +0000
864 | date: Thu Jan 01 00:00:00 1970 +0000
865 | summary: aaa
865 | summary: aaa
866 |
866 |
867 | o changeset: 3:1910d5ff34ea
867 | o changeset: 3:1910d5ff34ea
868 | | user: test
868 | | user: test
869 | | date: Thu Jan 01 00:00:00 1970 +0000
869 | | date: Thu Jan 01 00:00:00 1970 +0000
870 | | summary: second source with subdir
870 | | summary: second source with subdir
871 | |
871 | |
872 | o changeset: 2:82901330b6ef
872 | o changeset: 2:82901330b6ef
873 |/ user: test
873 |/ user: test
874 | date: Thu Jan 01 00:00:00 1970 +0000
874 | date: Thu Jan 01 00:00:00 1970 +0000
875 | summary: first source commit
875 | summary: first source commit
876 |
876 |
877 o changeset: 1:58d79cc1cf43
877 o changeset: 1:58d79cc1cf43
878 | user: test
878 | user: test
879 | date: Thu Jan 01 00:00:00 1970 +0000
879 | date: Thu Jan 01 00:00:00 1970 +0000
880 | summary: dest commit
880 | summary: dest commit
881 |
881 |
882 o changeset: 0:e94b687f7da3
882 o changeset: 0:e94b687f7da3
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: initial commit
885 summary: initial commit
886
886
887
887
888 Testing from lower head
888 Testing from lower head
889
889
890 $ hg up 3
890 $ hg up 3
891 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
891 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
892 $ hg log -r '_destrebase()'
892 $ hg log -r '_destrebase()'
893 changeset: 4:5f7bc9025ed2
893 changeset: 4:5f7bc9025ed2
894 tag: tip
894 tag: tip
895 parent: 1:58d79cc1cf43
895 parent: 1:58d79cc1cf43
896 user: test
896 user: test
897 date: Thu Jan 01 00:00:00 1970 +0000
897 date: Thu Jan 01 00:00:00 1970 +0000
898 summary: aaa
898 summary: aaa
899
899
900
900
901 Testing from upper head
901 Testing from upper head
902
902
903 $ hg log -r '_destrebase(4)'
903 $ hg log -r '_destrebase(4)'
904 changeset: 3:1910d5ff34ea
904 changeset: 3:1910d5ff34ea
905 user: test
905 user: test
906 date: Thu Jan 01 00:00:00 1970 +0000
906 date: Thu Jan 01 00:00:00 1970 +0000
907 summary: second source with subdir
907 summary: second source with subdir
908
908
909 $ hg up 4
909 $ hg up 4
910 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
910 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
911 $ hg log -r '_destrebase()'
911 $ hg log -r '_destrebase()'
912 changeset: 3:1910d5ff34ea
912 changeset: 3:1910d5ff34ea
913 user: test
913 user: test
914 date: Thu Jan 01 00:00:00 1970 +0000
914 date: Thu Jan 01 00:00:00 1970 +0000
915 summary: second source with subdir
915 summary: second source with subdir
916
916
917 Testing rebase being called inside another transaction
917 Testing rebase being called inside another transaction
918
918
919 $ cd $TESTTMP
919 $ cd $TESTTMP
920 $ hg init tr-state
920 $ hg init tr-state
921 $ cd tr-state
921 $ cd tr-state
922 $ cat > $TESTTMP/wraprebase.py <<EOF
922 $ cat > $TESTTMP/wraprebase.py <<EOF
923 > from __future__ import absolute_import
923 > from __future__ import absolute_import
924 > from mercurial import extensions
924 > from mercurial import extensions
925 > def _rebase(orig, ui, repo, *args, **kwargs):
925 > def _rebase(orig, ui, repo, *args, **kwargs):
926 > with repo.wlock():
926 > with repo.wlock():
927 > with repo.lock():
927 > with repo.lock():
928 > with repo.transaction('wrappedrebase'):
928 > with repo.transaction('wrappedrebase'):
929 > return orig(ui, repo, *args, **kwargs)
929 > return orig(ui, repo, *args, **kwargs)
930 > def wraprebase(loaded):
930 > def wraprebase(loaded):
931 > assert loaded
931 > assert loaded
932 > rebasemod = extensions.find('rebase')
932 > rebasemod = extensions.find('rebase')
933 > extensions.wrapcommand(rebasemod.cmdtable, 'rebase', _rebase)
933 > extensions.wrapcommand(rebasemod.cmdtable, 'rebase', _rebase)
934 > def extsetup(ui):
934 > def extsetup(ui):
935 > extensions.afterloaded('rebase', wraprebase)
935 > extensions.afterloaded('rebase', wraprebase)
936 > EOF
936 > EOF
937
937
938 $ cat >> .hg/hgrc <<EOF
938 $ cat >> .hg/hgrc <<EOF
939 > [extensions]
939 > [extensions]
940 > wraprebase=$TESTTMP/wraprebase.py
940 > wraprebase=$TESTTMP/wraprebase.py
941 > [experimental]
941 > [experimental]
942 > evolution=all
942 > evolution=all
943 > EOF
943 > EOF
944
944
945 $ hg debugdrawdag <<'EOS'
945 $ hg debugdrawdag <<'EOS'
946 > B C
946 > B C
947 > |/
947 > |/
948 > A
948 > A
949 > EOS
949 > EOS
950
950
951 $ hg rebase -s C -d B
951 $ hg rebase -s C -d B
952 rebasing 2:dc0947a82db8 "C" (C tip)
952 rebasing 2:dc0947a82db8 "C" (C tip)
953
953
954 $ [ -f .hg/rebasestate ] && echo 'WRONG: rebasestate should not exist'
954 $ [ -f .hg/rebasestate ] && echo 'WRONG: rebasestate should not exist'
955 [1]
955 [1]
@@ -1,272 +1,275 b''
1 test sparse
1 test sparse
2
2
3 $ hg init myrepo
3 $ hg init myrepo
4 $ cd myrepo
4 $ cd myrepo
5 $ cat > .hg/hgrc <<EOF
5 $ cat > .hg/hgrc <<EOF
6 > [extensions]
6 > [extensions]
7 > sparse=
7 > sparse=
8 > purge=
8 > purge=
9 > strip=
9 > strip=
10 > rebase=
10 > rebase=
11 > EOF
11 > EOF
12
12
13 $ echo a > index.html
13 $ echo a > index.html
14 $ echo x > data.py
14 $ echo x > data.py
15 $ echo z > readme.txt
15 $ echo z > readme.txt
16 $ cat > webpage.sparse <<EOF
16 $ cat > webpage.sparse <<EOF
17 > # frontend sparse profile
17 > # frontend sparse profile
18 > [include]
18 > [include]
19 > *.html
19 > *.html
20 > EOF
20 > EOF
21 $ cat > backend.sparse <<EOF
21 $ cat > backend.sparse <<EOF
22 > # backend sparse profile
22 > # backend sparse profile
23 > [include]
23 > [include]
24 > *.py
24 > *.py
25 > EOF
25 > EOF
26 $ hg ci -Aqm 'initial'
26 $ hg ci -Aqm 'initial'
27
27
28 $ hg debugsparse --include '*.sparse'
28 $ hg debugsparse --include '*.sparse'
29
29
30 Verify enabling a single profile works
30 Verify enabling a single profile works
31
31
32 $ hg debugsparse --enable-profile webpage.sparse
32 $ hg debugsparse --enable-profile webpage.sparse
33 $ ls
33 $ ls
34 backend.sparse
34 backend.sparse
35 index.html
35 index.html
36 webpage.sparse
36 webpage.sparse
37
37
38 Verify enabling two profiles works
38 Verify enabling two profiles works
39
39
40 $ hg debugsparse --enable-profile backend.sparse
40 $ hg debugsparse --enable-profile backend.sparse
41 $ ls
41 $ ls
42 backend.sparse
42 backend.sparse
43 data.py
43 data.py
44 index.html
44 index.html
45 webpage.sparse
45 webpage.sparse
46
46
47 Verify disabling a profile works
47 Verify disabling a profile works
48
48
49 $ hg debugsparse --disable-profile webpage.sparse
49 $ hg debugsparse --disable-profile webpage.sparse
50 $ ls
50 $ ls
51 backend.sparse
51 backend.sparse
52 data.py
52 data.py
53 webpage.sparse
53 webpage.sparse
54
54
55 Verify that a profile is updated across multiple commits
55 Verify that a profile is updated across multiple commits
56
56
57 $ cat > webpage.sparse <<EOF
57 $ cat > webpage.sparse <<EOF
58 > # frontend sparse profile
58 > # frontend sparse profile
59 > [include]
59 > [include]
60 > *.html
60 > *.html
61 > EOF
61 > EOF
62 $ cat > backend.sparse <<EOF
62 $ cat > backend.sparse <<EOF
63 > # backend sparse profile
63 > # backend sparse profile
64 > [include]
64 > [include]
65 > *.py
65 > *.py
66 > *.txt
66 > *.txt
67 > EOF
67 > EOF
68
68
69 $ echo foo >> data.py
69 $ echo foo >> data.py
70
70
71 $ hg ci -m 'edit profile'
71 $ hg ci -m 'edit profile'
72 $ ls
72 $ ls
73 backend.sparse
73 backend.sparse
74 data.py
74 data.py
75 readme.txt
75 readme.txt
76 webpage.sparse
76 webpage.sparse
77
77
78 $ hg up -q 0
78 $ hg up -q 0
79 $ ls
79 $ ls
80 backend.sparse
80 backend.sparse
81 data.py
81 data.py
82 webpage.sparse
82 webpage.sparse
83
83
84 $ hg up -q 1
84 $ hg up -q 1
85 $ ls
85 $ ls
86 backend.sparse
86 backend.sparse
87 data.py
87 data.py
88 readme.txt
88 readme.txt
89 webpage.sparse
89 webpage.sparse
90
90
91 Introduce a conflicting .hgsparse change
91 Introduce a conflicting .hgsparse change
92
92
93 $ hg up -q 0
93 $ hg up -q 0
94 $ cat > backend.sparse <<EOF
94 $ cat > backend.sparse <<EOF
95 > # Different backend sparse profile
95 > # Different backend sparse profile
96 > [include]
96 > [include]
97 > *.html
97 > *.html
98 > EOF
98 > EOF
99 $ echo bar >> data.py
99 $ echo bar >> data.py
100
100
101 $ hg ci -qAm "edit profile other"
101 $ hg ci -qAm "edit profile other"
102 $ ls
102 $ ls
103 backend.sparse
103 backend.sparse
104 index.html
104 index.html
105 webpage.sparse
105 webpage.sparse
106
106
107 Verify conflicting merge pulls in the conflicting changes
107 Verify conflicting merge pulls in the conflicting changes
108
108
109 $ hg merge 1
109 $ hg merge 1
110 temporarily included 1 file(s) in the sparse checkout for merging
110 temporarily included 1 file(s) in the sparse checkout for merging
111 merging backend.sparse
111 merging backend.sparse
112 merging data.py
112 merging data.py
113 warning: conflicts while merging backend.sparse! (edit, then use 'hg resolve --mark')
113 warning: conflicts while merging backend.sparse! (edit, then use 'hg resolve --mark')
114 warning: conflicts while merging data.py! (edit, then use 'hg resolve --mark')
114 warning: conflicts while merging data.py! (edit, then use 'hg resolve --mark')
115 0 files updated, 0 files merged, 0 files removed, 2 files unresolved
115 0 files updated, 0 files merged, 0 files removed, 2 files unresolved
116 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
116 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
117 [1]
117 [1]
118
118
119 $ rm *.orig
119 $ rm *.orig
120 $ ls
120 $ ls
121 backend.sparse
121 backend.sparse
122 data.py
122 data.py
123 index.html
123 index.html
124 webpage.sparse
124 webpage.sparse
125
125
126 Verify resolving the merge removes the temporarily unioned files
126 Verify resolving the merge removes the temporarily unioned files
127
127
128 $ cat > backend.sparse <<EOF
128 $ cat > backend.sparse <<EOF
129 > # backend sparse profile
129 > # backend sparse profile
130 > [include]
130 > [include]
131 > *.html
131 > *.html
132 > *.txt
132 > *.txt
133 > EOF
133 > EOF
134 $ hg resolve -m backend.sparse
134 $ hg resolve -m backend.sparse
135
135
136 $ cat > data.py <<EOF
136 $ cat > data.py <<EOF
137 > x
137 > x
138 > foo
138 > foo
139 > bar
139 > bar
140 > EOF
140 > EOF
141 $ hg resolve -m data.py
141 $ hg resolve -m data.py
142 (no more unresolved files)
142 (no more unresolved files)
143
143
144 $ hg ci -qAm "merge profiles"
144 $ hg ci -qAm "merge profiles"
145 $ ls
145 $ ls
146 backend.sparse
146 backend.sparse
147 index.html
147 index.html
148 readme.txt
148 readme.txt
149 webpage.sparse
149 webpage.sparse
150
150
151 $ hg cat -r . data.py
151 $ hg cat -r . data.py
152 x
152 x
153 foo
153 foo
154 bar
154 bar
155
155
156 Verify stripping refreshes dirstate
156 Verify stripping refreshes dirstate
157
157
158 $ hg strip -q -r .
158 $ hg strip -q -r .
159 $ ls
159 $ ls
160 backend.sparse
160 backend.sparse
161 index.html
161 index.html
162 webpage.sparse
162 webpage.sparse
163
163
164 Verify rebase conflicts pulls in the conflicting changes
164 Verify rebase conflicts pulls in the conflicting changes
165
165
166 $ hg up -q 1
166 $ hg up -q 1
167 $ ls
167 $ ls
168 backend.sparse
168 backend.sparse
169 data.py
169 data.py
170 readme.txt
170 readme.txt
171 webpage.sparse
171 webpage.sparse
172
172
173 $ hg rebase -d 2
173 $ hg rebase -d 2
174 rebasing 1:a2b1de640a62 "edit profile"
174 rebasing 1:a2b1de640a62 "edit profile"
175 temporarily included 1 file(s) in the sparse checkout for merging
175 temporarily included 1 file(s) in the sparse checkout for merging
176 merging backend.sparse
176 merging backend.sparse
177 merging data.py
177 merging data.py
178 warning: conflicts while merging backend.sparse! (edit, then use 'hg resolve --mark')
178 warning: conflicts while merging backend.sparse! (edit, then use 'hg resolve --mark')
179 warning: conflicts while merging data.py! (edit, then use 'hg resolve --mark')
179 warning: conflicts while merging data.py! (edit, then use 'hg resolve --mark')
180 unresolved conflicts (see hg resolve, then hg rebase --continue)
180 unresolved conflicts (see hg resolve, then hg rebase --continue)
181 [1]
181 [1]
182 $ rm *.orig
182 $ rm *.orig
183 $ ls
183 $ ls
184 backend.sparse
184 backend.sparse
185 data.py
185 data.py
186 index.html
186 index.html
187 webpage.sparse
187 webpage.sparse
188
188
189 Verify resolving conflict removes the temporary files
189 Verify resolving conflict removes the temporary files
190
190
191 $ cat > backend.sparse <<EOF
191 $ cat > backend.sparse <<EOF
192 > [include]
192 > [include]
193 > *.html
193 > *.html
194 > *.txt
194 > *.txt
195 > EOF
195 > EOF
196 $ hg resolve -m backend.sparse
196 $ hg resolve -m backend.sparse
197
197
198 $ cat > data.py <<EOF
198 $ cat > data.py <<EOF
199 > x
199 > x
200 > foo
200 > foo
201 > bar
201 > bar
202 > EOF
202 > EOF
203 $ hg resolve -m data.py
203 $ hg resolve -m data.py
204 (no more unresolved files)
204 (no more unresolved files)
205 continue: hg rebase --continue
205 continue: hg rebase --continue
206
206
207 $ hg rebase -q --continue
207 $ hg rebase -q --continue
208 $ ls
208 $ ls
209 backend.sparse
209 backend.sparse
210 index.html
210 index.html
211 readme.txt
211 readme.txt
212 webpage.sparse
212 webpage.sparse
213
213
214 $ hg cat -r . data.py
214 $ hg cat -r . data.py
215 x
215 x
216 foo
216 foo
217 bar
217 bar
218
218
219 Test checking out a commit that does not contain the sparse profile. The
219 Test checking out a commit that does not contain the sparse profile. The
220 warning message can be suppressed by setting missingwarning = false in
220 warning message can be suppressed by setting missingwarning = false in
221 [sparse] section of your config:
221 [sparse] section of your config:
222
222
223 $ hg debugsparse --reset
223 $ hg debugsparse --reset
224 $ hg rm *.sparse
224 $ hg rm *.sparse
225 $ hg commit -m "delete profiles"
225 $ hg commit -m "delete profiles"
226 $ hg up -q ".^"
226 $ hg up -q ".^"
227 $ hg debugsparse --enable-profile backend.sparse
227 $ hg debugsparse --enable-profile backend.sparse
228 $ ls
228 $ ls
229 index.html
229 index.html
230 readme.txt
230 readme.txt
231 $ hg up tip | grep warning
231 $ hg up tip | grep warning
232 warning: sparse profile 'backend.sparse' not found in rev bfcb76de99cc - ignoring it
232 warning: sparse profile 'backend.sparse' not found in rev bfcb76de99cc - ignoring it
233 [1]
233 [1]
234 $ ls
234 $ ls
235 data.py
235 data.py
236 index.html
236 index.html
237 readme.txt
237 readme.txt
238 $ hg debugsparse --disable-profile backend.sparse | grep warning
238 $ hg debugsparse --disable-profile backend.sparse | grep warning
239 warning: sparse profile 'backend.sparse' not found in rev bfcb76de99cc - ignoring it
239 warning: sparse profile 'backend.sparse' not found in rev bfcb76de99cc - ignoring it
240 [1]
240 [1]
241 $ cat >> .hg/hgrc <<EOF
241 $ cat >> .hg/hgrc <<EOF
242 > [sparse]
242 > [sparse]
243 > missingwarning = false
243 > missingwarning = false
244 > EOF
244 > EOF
245 $ hg debugsparse --enable-profile backend.sparse
245 $ hg debugsparse --enable-profile backend.sparse
246
246
247 $ cd ..
247 $ cd ..
248
248
249 #if unix-permissions
250
249 Test file permissions changing across a sparse profile change
251 Test file permissions changing across a sparse profile change
250 $ hg init sparseperm
252 $ hg init sparseperm
251 $ cd sparseperm
253 $ cd sparseperm
252 $ cat > .hg/hgrc <<EOF
254 $ cat > .hg/hgrc <<EOF
253 > [extensions]
255 > [extensions]
254 > sparse=
256 > sparse=
255 > EOF
257 > EOF
256 $ touch a b
258 $ touch a b
257 $ cat > .hgsparse <<EOF
259 $ cat > .hgsparse <<EOF
258 > a
260 > a
259 > EOF
261 > EOF
260 $ hg commit -Aqm 'initial'
262 $ hg commit -Aqm 'initial'
261 $ chmod a+x b
263 $ chmod a+x b
262 $ hg commit -qm 'make executable'
264 $ hg commit -qm 'make executable'
263 $ cat >> .hgsparse <<EOF
265 $ cat >> .hgsparse <<EOF
264 > b
266 > b
265 > EOF
267 > EOF
266 $ hg commit -qm 'update profile'
268 $ hg commit -qm 'update profile'
267 $ hg up -q 0
269 $ hg up -q 0
268 $ hg debugsparse --enable-profile .hgsparse
270 $ hg debugsparse --enable-profile .hgsparse
269 $ hg up -q 2
271 $ hg up -q 2
270 $ ls -l b
272 $ ls -l b
271 -rwxr-xr-x* b (glob)
273 -rwxr-xr-x* b (glob)
272
274
275 #endif
@@ -1,353 +1,365 b''
1 test sparse
1 test sparse
2
2
3 $ hg init myrepo
3 $ hg init myrepo
4 $ cd myrepo
4 $ cd myrepo
5 $ cat > .hg/hgrc <<EOF
5 $ cat > .hg/hgrc <<EOF
6 > [extensions]
6 > [extensions]
7 > sparse=
7 > sparse=
8 > strip=
8 > strip=
9 > EOF
9 > EOF
10
10
11 $ echo a > show
11 $ echo a > show
12 $ echo x > hide
12 $ echo x > hide
13 $ hg ci -Aqm 'initial'
13 $ hg ci -Aqm 'initial'
14
14
15 $ echo b > show
15 $ echo b > show
16 $ echo y > hide
16 $ echo y > hide
17 $ echo aa > show2
17 $ echo aa > show2
18 $ echo xx > hide2
18 $ echo xx > hide2
19 $ hg ci -Aqm 'two'
19 $ hg ci -Aqm 'two'
20
20
21 Verify basic --include
21 Verify basic --include
22
22
23 $ hg up -q 0
23 $ hg up -q 0
24 $ hg debugsparse --include 'hide'
24 $ hg debugsparse --include 'hide'
25 $ ls
25 $ ls
26 hide
26 hide
27
27
28 Absolute paths outside the repo should just be rejected
28 Absolute paths outside the repo should just be rejected
29
29
30 #if no-windows
30 $ hg debugsparse --include /foo/bar
31 $ hg debugsparse --include /foo/bar
31 warning: paths cannot start with /, ignoring: ['/foo/bar']
32 warning: paths cannot start with /, ignoring: ['/foo/bar']
32 $ hg debugsparse --include '$TESTTMP/myrepo/hide'
33 $ hg debugsparse --include '$TESTTMP/myrepo/hide'
33
34
34 $ hg debugsparse --include '/root'
35 $ hg debugsparse --include '/root'
35 warning: paths cannot start with /, ignoring: ['/root']
36 warning: paths cannot start with /, ignoring: ['/root']
37 #else
38 TODO: See if this can be made to fail the same way as on Unix
39 $ hg debugsparse --include /c/foo/bar
40 abort: c:/foo/bar not under root '$TESTTMP/myrepo' (glob)
41 [255]
42 $ hg debugsparse --include '$TESTTMP/myrepo/hide'
43
44 $ hg debugsparse --include '/c/root'
45 abort: c:/root not under root '$TESTTMP/myrepo' (glob)
46 [255]
47 #endif
36
48
37 Verify commiting while sparse includes other files
49 Verify commiting while sparse includes other files
38
50
39 $ echo z > hide
51 $ echo z > hide
40 $ hg ci -Aqm 'edit hide'
52 $ hg ci -Aqm 'edit hide'
41 $ ls
53 $ ls
42 hide
54 hide
43 $ hg manifest
55 $ hg manifest
44 hide
56 hide
45 show
57 show
46
58
47 Verify --reset brings files back
59 Verify --reset brings files back
48
60
49 $ hg debugsparse --reset
61 $ hg debugsparse --reset
50 $ ls
62 $ ls
51 hide
63 hide
52 show
64 show
53 $ cat hide
65 $ cat hide
54 z
66 z
55 $ cat show
67 $ cat show
56 a
68 a
57
69
58 Verify 'hg debugsparse' default output
70 Verify 'hg debugsparse' default output
59
71
60 $ hg up -q null
72 $ hg up -q null
61 $ hg debugsparse --include 'show*'
73 $ hg debugsparse --include 'show*'
62
74
63 $ hg debugsparse
75 $ hg debugsparse
64 [include]
76 [include]
65 show*
77 show*
66
78
67 Verify update only writes included files
79 Verify update only writes included files
68
80
69 $ hg up -q 0
81 $ hg up -q 0
70 $ ls
82 $ ls
71 show
83 show
72
84
73 $ hg up -q 1
85 $ hg up -q 1
74 $ ls
86 $ ls
75 show
87 show
76 show2
88 show2
77
89
78 Verify status only shows included files
90 Verify status only shows included files
79
91
80 $ touch hide
92 $ touch hide
81 $ touch hide3
93 $ touch hide3
82 $ echo c > show
94 $ echo c > show
83 $ hg status
95 $ hg status
84 M show
96 M show
85
97
86 Adding an excluded file should fail
98 Adding an excluded file should fail
87
99
88 $ hg add hide3
100 $ hg add hide3
89 abort: cannot add 'hide3' - it is outside the sparse checkout
101 abort: cannot add 'hide3' - it is outside the sparse checkout
90 (include file with `hg debugsparse --include <pattern>` or use `hg add -s <file>` to include file directory while adding)
102 (include file with `hg debugsparse --include <pattern>` or use `hg add -s <file>` to include file directory while adding)
91 [255]
103 [255]
92
104
93 Verify deleting sparseness while a file has changes fails
105 Verify deleting sparseness while a file has changes fails
94
106
95 $ hg debugsparse --delete 'show*'
107 $ hg debugsparse --delete 'show*'
96 pending changes to 'hide'
108 pending changes to 'hide'
97 abort: cannot change sparseness due to pending changes (delete the files or use --force to bring them back dirty)
109 abort: cannot change sparseness due to pending changes (delete the files or use --force to bring them back dirty)
98 [255]
110 [255]
99
111
100 Verify deleting sparseness with --force brings back files
112 Verify deleting sparseness with --force brings back files
101
113
102 $ hg debugsparse --delete -f 'show*'
114 $ hg debugsparse --delete -f 'show*'
103 pending changes to 'hide'
115 pending changes to 'hide'
104 $ ls
116 $ ls
105 hide
117 hide
106 hide2
118 hide2
107 hide3
119 hide3
108 show
120 show
109 show2
121 show2
110 $ hg st
122 $ hg st
111 M hide
123 M hide
112 M show
124 M show
113 ? hide3
125 ? hide3
114
126
115 Verify editing sparseness fails if pending changes
127 Verify editing sparseness fails if pending changes
116
128
117 $ hg debugsparse --include 'show*'
129 $ hg debugsparse --include 'show*'
118 pending changes to 'hide'
130 pending changes to 'hide'
119 abort: could not update sparseness due to pending changes
131 abort: could not update sparseness due to pending changes
120 [255]
132 [255]
121
133
122 Verify adding sparseness hides files
134 Verify adding sparseness hides files
123
135
124 $ hg debugsparse --exclude -f 'hide*'
136 $ hg debugsparse --exclude -f 'hide*'
125 pending changes to 'hide'
137 pending changes to 'hide'
126 $ ls
138 $ ls
127 hide
139 hide
128 hide3
140 hide3
129 show
141 show
130 show2
142 show2
131 $ hg st
143 $ hg st
132 M show
144 M show
133
145
134 $ hg up -qC .
146 $ hg up -qC .
135 $ hg purge --all --config extensions.purge=
147 $ hg purge --all --config extensions.purge=
136 $ ls
148 $ ls
137 show
149 show
138 show2
150 show2
139
151
140 Verify rebase temporarily includes excluded files
152 Verify rebase temporarily includes excluded files
141
153
142 $ hg rebase -d 1 -r 2 --config extensions.rebase=
154 $ hg rebase -d 1 -r 2 --config extensions.rebase=
143 rebasing 2:b91df4f39e75 "edit hide" (tip)
155 rebasing 2:b91df4f39e75 "edit hide" (tip)
144 temporarily included 1 file(s) in the sparse checkout for merging
156 temporarily included 1 file(s) in the sparse checkout for merging
145 merging hide
157 merging hide
146 warning: conflicts while merging hide! (edit, then use 'hg resolve --mark')
158 warning: conflicts while merging hide! (edit, then use 'hg resolve --mark')
147 unresolved conflicts (see hg resolve, then hg rebase --continue)
159 unresolved conflicts (see hg resolve, then hg rebase --continue)
148 [1]
160 [1]
149
161
150 $ hg debugsparse
162 $ hg debugsparse
151 [exclude]
163 [exclude]
152 hide*
164 hide*
153
165
154 Temporarily Included Files (for merge/rebase):
166 Temporarily Included Files (for merge/rebase):
155 hide
167 hide
156
168
157 $ cat hide
169 $ cat hide
158 <<<<<<< dest: 39278f7c08a9 - test: two
170 <<<<<<< dest: 39278f7c08a9 - test: two
159 y
171 y
160 =======
172 =======
161 z
173 z
162 >>>>>>> source: b91df4f39e75 - test: edit hide
174 >>>>>>> source: b91df4f39e75 - test: edit hide
163
175
164 Verify aborting a rebase cleans up temporary files
176 Verify aborting a rebase cleans up temporary files
165
177
166 $ hg rebase --abort --config extensions.rebase=
178 $ hg rebase --abort --config extensions.rebase=
167 cleaned up 1 temporarily added file(s) from the sparse checkout
179 cleaned up 1 temporarily added file(s) from the sparse checkout
168 rebase aborted
180 rebase aborted
169 $ rm hide.orig
181 $ rm hide.orig
170
182
171 $ ls
183 $ ls
172 show
184 show
173 show2
185 show2
174
186
175 Verify merge fails if merging excluded files
187 Verify merge fails if merging excluded files
176
188
177 $ hg up -q 1
189 $ hg up -q 1
178 $ hg merge -r 2
190 $ hg merge -r 2
179 temporarily included 1 file(s) in the sparse checkout for merging
191 temporarily included 1 file(s) in the sparse checkout for merging
180 merging hide
192 merging hide
181 warning: conflicts while merging hide! (edit, then use 'hg resolve --mark')
193 warning: conflicts while merging hide! (edit, then use 'hg resolve --mark')
182 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
194 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
183 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
195 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
184 [1]
196 [1]
185 $ hg debugsparse
197 $ hg debugsparse
186 [exclude]
198 [exclude]
187 hide*
199 hide*
188
200
189 Temporarily Included Files (for merge/rebase):
201 Temporarily Included Files (for merge/rebase):
190 hide
202 hide
191
203
192 $ hg up -C .
204 $ hg up -C .
193 cleaned up 1 temporarily added file(s) from the sparse checkout
205 cleaned up 1 temporarily added file(s) from the sparse checkout
194 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
206 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
195 $ hg debugsparse
207 $ hg debugsparse
196 [exclude]
208 [exclude]
197 hide*
209 hide*
198
210
199
211
200 Verify strip -k resets dirstate correctly
212 Verify strip -k resets dirstate correctly
201
213
202 $ hg status
214 $ hg status
203 $ hg debugsparse
215 $ hg debugsparse
204 [exclude]
216 [exclude]
205 hide*
217 hide*
206
218
207 $ hg log -r . -T '{rev}\n' --stat
219 $ hg log -r . -T '{rev}\n' --stat
208 1
220 1
209 hide | 2 +-
221 hide | 2 +-
210 hide2 | 1 +
222 hide2 | 1 +
211 show | 2 +-
223 show | 2 +-
212 show2 | 1 +
224 show2 | 1 +
213 4 files changed, 4 insertions(+), 2 deletions(-)
225 4 files changed, 4 insertions(+), 2 deletions(-)
214
226
215 $ hg strip -r . -k
227 $ hg strip -r . -k
216 saved backup bundle to $TESTTMP/myrepo/.hg/strip-backup/39278f7c08a9-ce59e002-backup.hg (glob)
228 saved backup bundle to $TESTTMP/myrepo/.hg/strip-backup/39278f7c08a9-ce59e002-backup.hg (glob)
217 $ hg status
229 $ hg status
218 M show
230 M show
219 ? show2
231 ? show2
220
232
221 Verify rebase succeeds if all changed files are in sparse checkout
233 Verify rebase succeeds if all changed files are in sparse checkout
222
234
223 $ hg commit -Aqm "add show2"
235 $ hg commit -Aqm "add show2"
224 $ hg rebase -d 1 --config extensions.rebase=
236 $ hg rebase -d 1 --config extensions.rebase=
225 rebasing 2:bdde55290160 "add show2" (tip)
237 rebasing 2:bdde55290160 "add show2" (tip)
226 saved backup bundle to $TESTTMP/myrepo/.hg/strip-backup/bdde55290160-216ed9c6-rebase.hg (glob)
238 saved backup bundle to $TESTTMP/myrepo/.hg/strip-backup/bdde55290160-216ed9c6-rebase.hg (glob)
227
239
228 Verify log --sparse only shows commits that affect the sparse checkout
240 Verify log --sparse only shows commits that affect the sparse checkout
229
241
230 $ hg log -T '{rev} '
242 $ hg log -T '{rev} '
231 2 1 0 (no-eol)
243 2 1 0 (no-eol)
232 $ hg log --sparse -T '{rev} '
244 $ hg log --sparse -T '{rev} '
233 2 0 (no-eol)
245 2 0 (no-eol)
234
246
235 Test status on a file in a subdir
247 Test status on a file in a subdir
236
248
237 $ mkdir -p dir1/dir2
249 $ mkdir -p dir1/dir2
238 $ touch dir1/dir2/file
250 $ touch dir1/dir2/file
239 $ hg debugsparse -I dir1/dir2
251 $ hg debugsparse -I dir1/dir2
240 $ hg status
252 $ hg status
241 ? dir1/dir2/file
253 ? dir1/dir2/file
242
254
243 Test that add -s adds dirs to sparse profile
255 Test that add -s adds dirs to sparse profile
244
256
245 $ hg debugsparse --reset
257 $ hg debugsparse --reset
246 $ hg debugsparse --include empty
258 $ hg debugsparse --include empty
247 $ hg debugsparse
259 $ hg debugsparse
248 [include]
260 [include]
249 empty
261 empty
250
262
251
263
252 $ mkdir add
264 $ mkdir add
253 $ touch add/foo
265 $ touch add/foo
254 $ touch add/bar
266 $ touch add/bar
255 $ hg add add/foo
267 $ hg add add/foo
256 abort: cannot add 'add/foo' - it is outside the sparse checkout
268 abort: cannot add 'add/foo' - it is outside the sparse checkout
257 (include file with `hg debugsparse --include <pattern>` or use `hg add -s <file>` to include file directory while adding)
269 (include file with `hg debugsparse --include <pattern>` or use `hg add -s <file>` to include file directory while adding)
258 [255]
270 [255]
259 $ hg add -s add/foo
271 $ hg add -s add/foo
260 $ hg st
272 $ hg st
261 A add/foo
273 A add/foo
262 ? add/bar
274 ? add/bar
263 $ hg debugsparse
275 $ hg debugsparse
264 [include]
276 [include]
265 add
277 add
266 empty
278 empty
267
279
268 $ hg add -s add/*
280 $ hg add -s add/*
269 add/foo already tracked!
281 add/foo already tracked!
270 $ hg st
282 $ hg st
271 A add/bar
283 A add/bar
272 A add/foo
284 A add/foo
273 $ hg debugsparse
285 $ hg debugsparse
274 [include]
286 [include]
275 add
287 add
276 empty
288 empty
277
289
278
290
279 $ cd ..
291 $ cd ..
280
292
281 Test non-sparse repos work while sparse is loaded
293 Test non-sparse repos work while sparse is loaded
282 $ hg init sparserepo
294 $ hg init sparserepo
283 $ hg init nonsparserepo
295 $ hg init nonsparserepo
284 $ cd sparserepo
296 $ cd sparserepo
285 $ cat > .hg/hgrc <<EOF
297 $ cat > .hg/hgrc <<EOF
286 > [extensions]
298 > [extensions]
287 > sparse=
299 > sparse=
288 > EOF
300 > EOF
289 $ cd ../nonsparserepo
301 $ cd ../nonsparserepo
290 $ echo x > x && hg add x && hg commit -qAm x
302 $ echo x > x && hg add x && hg commit -qAm x
291 $ cd ../sparserepo
303 $ cd ../sparserepo
292 $ hg clone ../nonsparserepo ../nonsparserepo2
304 $ hg clone ../nonsparserepo ../nonsparserepo2
293 updating to branch default
305 updating to branch default
294 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
306 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
295
307
296 Test debugrebuilddirstate
308 Test debugrebuilddirstate
297 $ cd ../sparserepo
309 $ cd ../sparserepo
298 $ touch included
310 $ touch included
299 $ touch excluded
311 $ touch excluded
300 $ hg add included excluded
312 $ hg add included excluded
301 $ hg commit -m 'a commit' -q
313 $ hg commit -m 'a commit' -q
302 $ cp .hg/dirstate ../dirstateboth
314 $ cp .hg/dirstate ../dirstateboth
303 $ hg debugsparse -X excluded
315 $ hg debugsparse -X excluded
304 $ cp ../dirstateboth .hg/dirstate
316 $ cp ../dirstateboth .hg/dirstate
305 $ hg debugrebuilddirstate
317 $ hg debugrebuilddirstate
306 $ hg debugdirstate
318 $ hg debugdirstate
307 n 0 -1 unset included
319 n 0 -1 unset included
308
320
309 Test debugdirstate --minimal where file is in the parent manifest but not the
321 Test debugdirstate --minimal where file is in the parent manifest but not the
310 dirstate
322 dirstate
311 $ hg debugsparse -X included
323 $ hg debugsparse -X included
312 $ hg debugdirstate
324 $ hg debugdirstate
313 $ cp .hg/dirstate ../dirstateallexcluded
325 $ cp .hg/dirstate ../dirstateallexcluded
314 $ hg debugsparse --reset
326 $ hg debugsparse --reset
315 $ hg debugsparse -X excluded
327 $ hg debugsparse -X excluded
316 $ cp ../dirstateallexcluded .hg/dirstate
328 $ cp ../dirstateallexcluded .hg/dirstate
317 $ touch includedadded
329 $ touch includedadded
318 $ hg add includedadded
330 $ hg add includedadded
319 $ hg debugdirstate --nodates
331 $ hg debugdirstate --nodates
320 a 0 -1 unset includedadded
332 a 0 -1 unset includedadded
321 $ hg debugrebuilddirstate --minimal
333 $ hg debugrebuilddirstate --minimal
322 $ hg debugdirstate --nodates
334 $ hg debugdirstate --nodates
323 n 0 -1 unset included
335 n 0 -1 unset included
324 a 0 -1 * includedadded (glob)
336 a 0 -1 * includedadded (glob)
325
337
326 Test debugdirstate --minimal where a file is not in parent manifest
338 Test debugdirstate --minimal where a file is not in parent manifest
327 but in the dirstate. This should take into account excluded files in the
339 but in the dirstate. This should take into account excluded files in the
328 manifest
340 manifest
329 $ cp ../dirstateboth .hg/dirstate
341 $ cp ../dirstateboth .hg/dirstate
330 $ touch includedadded
342 $ touch includedadded
331 $ hg add includedadded
343 $ hg add includedadded
332 $ touch excludednomanifest
344 $ touch excludednomanifest
333 $ hg add excludednomanifest
345 $ hg add excludednomanifest
334 $ cp .hg/dirstate ../moreexcluded
346 $ cp .hg/dirstate ../moreexcluded
335 $ hg forget excludednomanifest
347 $ hg forget excludednomanifest
336 $ rm excludednomanifest
348 $ rm excludednomanifest
337 $ hg debugsparse -X excludednomanifest
349 $ hg debugsparse -X excludednomanifest
338 $ cp ../moreexcluded .hg/dirstate
350 $ cp ../moreexcluded .hg/dirstate
339 $ hg manifest
351 $ hg manifest
340 excluded
352 excluded
341 included
353 included
342 We have files in the dirstate that are included and excluded. Some are in the
354 We have files in the dirstate that are included and excluded. Some are in the
343 manifest and some are not.
355 manifest and some are not.
344 $ hg debugdirstate --nodates
356 $ hg debugdirstate --nodates
345 n 644 0 * excluded (glob)
357 n 644 0 * excluded (glob)
346 a 0 -1 * excludednomanifest (glob)
358 a 0 -1 * excludednomanifest (glob)
347 n 644 0 * included (glob)
359 n 644 0 * included (glob)
348 a 0 -1 * includedadded (glob)
360 a 0 -1 * includedadded (glob)
349 $ hg debugrebuilddirstate --minimal
361 $ hg debugrebuilddirstate --minimal
350 $ hg debugdirstate --nodates
362 $ hg debugdirstate --nodates
351 n 644 0 * included (glob)
363 n 644 0 * included (glob)
352 a 0 -1 * includedadded (glob)
364 a 0 -1 * includedadded (glob)
353
365
General Comments 0
You need to be logged in to leave comments. Login now