Show More
@@ -1,392 +1,385 | |||||
1 | $ cat >> $HGRCPATH <<EOF |
|
1 | $ cat >> $HGRCPATH <<EOF | |
2 | > [extensions] |
|
2 | > [extensions] | |
3 | > graphlog= |
|
3 | > graphlog= | |
4 | > rebase= |
|
4 | > rebase= | |
5 | > |
|
5 | > | |
6 | > [alias] |
|
6 | > [alias] | |
7 | > tglog = log -G --template "{rev}: '{desc}' {branches}\n" |
|
7 | > tglog = log -G --template "{rev}: '{desc}' {branches}\n" | |
8 | > EOF |
|
8 | > EOF | |
9 |
|
9 | |||
10 |
|
10 | |||
11 | $ hg init a |
|
11 | $ hg init a | |
12 | $ cd a |
|
12 | $ cd a | |
13 |
|
13 | $ hg unbundle $TESTDIR/bundles/rebase.hg | ||
14 | $ echo c1 > c1 |
|
14 | adding changesets | |
15 | $ hg ci -Am c1 |
|
15 | adding manifests | |
16 |
adding |
|
16 | adding file changes | |
17 |
|
17 | added 8 changesets with 7 changes to 7 files (+2 heads) | ||
18 | $ echo c2 > c2 |
|
18 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
19 | $ hg ci -Am c2 |
|
19 | $ hg up tip | |
20 | adding c2 |
|
20 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
21 |
|
||||
22 | $ echo c3 > c3 |
|
|||
23 | $ hg ci -Am c3 |
|
|||
24 | adding c3 |
|
|||
25 |
|
||||
26 | $ hg up -q -C 1 |
|
|||
27 |
|
21 | |||
28 |
$ echo |
|
22 | $ echo I > I | |
29 |
$ hg ci -Am |
|
23 | $ hg ci -AmI | |
30 |
adding |
|
24 | adding I | |
31 | created new head |
|
|||
32 |
|
||||
33 | $ echo l2 > l2 |
|
|||
34 | $ hg ci -Am l2 |
|
|||
35 | adding l2 |
|
|||
36 |
|
||||
37 | $ echo l3 > l3 |
|
|||
38 | $ hg ci -Am l3 |
|
|||
39 | adding l3 |
|
|||
40 |
|
||||
41 | $ hg up -q -C 2 |
|
|||
42 |
|
||||
43 | $ echo r1 > r1 |
|
|||
44 | $ hg ci -Am r1 |
|
|||
45 | adding r1 |
|
|||
46 |
|
||||
47 | $ echo r2 > r2 |
|
|||
48 | $ hg ci -Am r2 |
|
|||
49 | adding r2 |
|
|||
50 |
|
25 | |||
51 | $ hg tglog |
|
26 | $ hg tglog | |
52 |
@ |
|
27 | @ 8: 'I' | |
53 | | |
|
28 | | | |
54 |
o |
|
29 | o 7: 'H' | |
55 | | |
|
30 | | | |
56 |
| o |
|
31 | | o 6: 'G' | |
57 |
| |
|
32 | |/| | |
58 |
| |
|
33 | o | 5: 'F' | |
59 | | | |
|
34 | | | | |
60 |
| o |
|
35 | | o 4: 'E' | |
61 | | | |
|
|||
62 | o | 2: 'c3' |
|
|||
63 | |/ |
|
36 | |/ | |
64 |
o |
|
37 | | o 3: 'D' | |
65 | | |
|
38 | | | | |
66 |
o |
|
39 | | o 2: 'C' | |
|
40 | | | | |||
|
41 | | o 1: 'B' | |||
|
42 | |/ | |||
|
43 | o 0: 'A' | |||
67 |
|
44 | |||
68 | $ cd .. |
|
45 | $ cd .. | |
69 |
|
46 | |||
70 |
|
47 | |||
71 | These fail: |
|
48 | These fail: | |
72 |
|
49 | |||
73 | $ hg clone -q -u . a a1 |
|
50 | $ hg clone -q -u . a a1 | |
74 | $ cd a1 |
|
51 | $ cd a1 | |
75 |
|
52 | |||
76 | $ hg rebase --continue --abort |
|
53 | $ hg rebase --continue --abort | |
77 | abort: cannot use both abort and continue |
|
54 | abort: cannot use both abort and continue | |
78 | [255] |
|
55 | [255] | |
79 |
|
56 | |||
80 | $ hg rebase --continue --collapse |
|
57 | $ hg rebase --continue --collapse | |
81 | abort: cannot use collapse with continue or abort |
|
58 | abort: cannot use collapse with continue or abort | |
82 | [255] |
|
59 | [255] | |
83 |
|
60 | |||
84 | $ hg rebase --continue --dest 4 |
|
61 | $ hg rebase --continue --dest 4 | |
85 | abort: abort and continue do not allow specifying revisions |
|
62 | abort: abort and continue do not allow specifying revisions | |
86 | [255] |
|
63 | [255] | |
87 |
|
64 | |||
88 | $ hg rebase --base 5 --source 4 |
|
65 | $ hg rebase --base 5 --source 4 | |
89 | abort: cannot specify both a revision and a base |
|
66 | abort: cannot specify both a revision and a base | |
90 | [255] |
|
67 | [255] | |
91 |
|
68 | |||
92 | $ hg rebase |
|
69 | $ hg rebase | |
93 | nothing to rebase |
|
70 | nothing to rebase | |
94 | [1] |
|
71 | [1] | |
95 |
|
72 | |||
96 |
$ hg up -q |
|
73 | $ hg up -q 7 | |
97 |
|
74 | |||
98 | $ hg rebase |
|
75 | $ hg rebase | |
99 | nothing to rebase |
|
76 | nothing to rebase | |
100 | [1] |
|
77 | [1] | |
101 |
|
78 | |||
102 |
|
79 | |||
103 | These work: |
|
80 | These work: | |
104 |
|
81 | |||
105 |
Rebase with no arguments (from 3 onto |
|
82 | Rebase with no arguments (from 3 onto 8): | |
106 |
|
83 | |||
107 |
$ hg up -q -C |
|
84 | $ hg up -q -C 3 | |
108 |
|
85 | |||
109 | $ hg rebase |
|
86 | $ hg rebase | |
110 | saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob) |
|
87 | saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob) | |
111 |
|
88 | |||
112 | $ hg tglog |
|
89 | $ hg tglog | |
113 |
@ |
|
90 | @ 8: 'D' | |
114 | | |
|
91 | | | |
115 |
o |
|
92 | o 7: 'C' | |
116 | | |
|
93 | | | |
117 |
o |
|
94 | o 6: 'B' | |
118 | | |
|
95 | | | |
119 |
o |
|
96 | o 5: 'I' | |
120 | | |
|
97 | | | |
121 |
o |
|
98 | o 4: 'H' | |
122 | | |
|
|||
123 | o 2: 'c3' |
|
|||
124 | | |
|
99 | | | |
125 |
o |
|
100 | | o 3: 'G' | |
126 | | |
|
101 | |/| | |
127 |
o |
|
102 | o | 2: 'F' | |
|
103 | | | | |||
|
104 | | o 1: 'E' | |||
|
105 | |/ | |||
|
106 | o 0: 'A' | |||
128 |
|
107 | |||
129 | Try to rollback after a rebase (fail): |
|
108 | Try to rollback after a rebase (fail): | |
130 |
|
109 | |||
131 | $ hg rollback |
|
110 | $ hg rollback | |
132 | no rollback information available |
|
111 | no rollback information available | |
133 | [1] |
|
112 | [1] | |
134 |
|
113 | |||
135 | $ cd .. |
|
114 | $ cd .. | |
136 |
|
115 | |||
137 |
|
116 | |||
138 |
Rebase with base == '.' => same as no arguments (from 3 onto |
|
117 | Rebase with base == '.' => same as no arguments (from 3 onto 8): | |
139 |
|
118 | |||
140 |
$ hg clone -q -u |
|
119 | $ hg clone -q -u 3 a a2 | |
141 | $ cd a2 |
|
120 | $ cd a2 | |
142 |
|
121 | |||
143 | $ hg rebase --base . |
|
122 | $ hg rebase --base . | |
144 | saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob) |
|
123 | saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob) | |
145 |
|
124 | |||
146 | $ hg tglog |
|
125 | $ hg tglog | |
147 |
@ |
|
126 | @ 8: 'D' | |
148 | | |
|
127 | | | |
149 |
o |
|
128 | o 7: 'C' | |
150 | | |
|
129 | | | |
151 |
o |
|
130 | o 6: 'B' | |
152 | | |
|
131 | | | |
153 |
o |
|
132 | o 5: 'I' | |
154 | | |
|
133 | | | |
155 |
o |
|
134 | o 4: 'H' | |
156 | | |
|
|||
157 | o 2: 'c3' |
|
|||
158 | | |
|
135 | | | |
159 |
o |
|
136 | | o 3: 'G' | |
160 | | |
|
137 | |/| | |
161 |
o |
|
138 | o | 2: 'F' | |
|
139 | | | | |||
|
140 | | o 1: 'E' | |||
|
141 | |/ | |||
|
142 | o 0: 'A' | |||
162 |
|
143 | |||
163 | $ cd .. |
|
144 | $ cd .. | |
164 |
|
145 | |||
165 |
|
146 | |||
166 |
Rebase with dest == `hg branch` => same as no arguments (from 3 onto |
|
147 | Rebase with dest == `hg branch` => same as no arguments (from 3 onto 8): | |
167 |
|
148 | |||
168 |
$ hg clone -q -u |
|
149 | $ hg clone -q -u 3 a a3 | |
169 | $ cd a3 |
|
150 | $ cd a3 | |
170 |
|
151 | |||
171 | $ hg rebase --dest `hg branch` |
|
152 | $ hg rebase --dest `hg branch` | |
172 | saved backup bundle to $TESTTMP/a3/.hg/strip-backup/*-backup.hg (glob) |
|
153 | saved backup bundle to $TESTTMP/a3/.hg/strip-backup/*-backup.hg (glob) | |
173 |
|
154 | |||
174 | $ hg tglog |
|
155 | $ hg tglog | |
175 |
@ |
|
156 | @ 8: 'D' | |
176 | | |
|
157 | | | |
177 |
o |
|
158 | o 7: 'C' | |
178 | | |
|
159 | | | |
179 |
o |
|
160 | o 6: 'B' | |
180 | | |
|
161 | | | |
181 |
o |
|
162 | o 5: 'I' | |
182 | | |
|
163 | | | |
183 |
o |
|
164 | o 4: 'H' | |
184 | | |
|
|||
185 | o 2: 'c3' |
|
|||
186 | | |
|
165 | | | |
187 |
o |
|
166 | | o 3: 'G' | |
188 | | |
|
167 | |/| | |
189 |
o |
|
168 | o | 2: 'F' | |
|
169 | | | | |||
|
170 | | o 1: 'E' | |||
|
171 | |/ | |||
|
172 | o 0: 'A' | |||
190 |
|
173 | |||
191 | $ cd .. |
|
174 | $ cd .. | |
192 |
|
175 | |||
193 |
|
176 | |||
194 |
Specify only source (from |
|
177 | Specify only source (from 2 onto 8): | |
195 |
|
178 | |||
196 | $ hg clone -q -u . a a4 |
|
179 | $ hg clone -q -u . a a4 | |
197 | $ cd a4 |
|
180 | $ cd a4 | |
198 |
|
181 | |||
199 |
$ hg rebase --source |
|
182 | $ hg rebase --source 2 | |
200 | saved backup bundle to $TESTTMP/a4/.hg/strip-backup/*-backup.hg (glob) |
|
183 | saved backup bundle to $TESTTMP/a4/.hg/strip-backup/*-backup.hg (glob) | |
201 |
|
184 | |||
202 | $ hg tglog |
|
185 | $ hg tglog | |
203 |
@ |
|
186 | @ 8: 'D' | |
204 | | |
|
187 | | | |
205 |
o |
|
188 | o 7: 'C' | |
206 | |\ |
|
189 | |\ | |
207 |
| o |
|
190 | | o 6: 'I' | |
208 | | | |
|
191 | | | | |
209 |
| o |
|
192 | | o 5: 'H' | |
210 | | | |
|
193 | | | | |
211 |
|
|
194 | | | o 4: 'G' | |
212 | | | |
|
195 | | |/| | |
213 |
| o |
|
196 | | o | 3: 'F' | |
|
197 | | | | | |||
|
198 | | | o 2: 'E' | |||
|
199 | | |/ | |||
|
200 | o | 1: 'B' | |||
214 | |/ |
|
201 | |/ | |
215 |
o |
|
202 | o 0: 'A' | |
216 | | |
|
|||
217 | o 0: 'c1' |
|
|||
218 |
|
203 | |||
219 | $ cd .. |
|
204 | $ cd .. | |
220 |
|
205 | |||
221 |
|
206 | |||
222 | Specify only dest (from 3 onto 6): |
|
207 | Specify only dest (from 3 onto 6): | |
223 |
|
208 | |||
224 |
$ hg clone -q -u |
|
209 | $ hg clone -q -u 3 a a5 | |
225 | $ cd a5 |
|
210 | $ cd a5 | |
226 |
|
211 | |||
227 | $ hg rebase --dest 6 |
|
212 | $ hg rebase --dest 6 | |
228 | saved backup bundle to $TESTTMP/a5/.hg/strip-backup/*-backup.hg (glob) |
|
213 | saved backup bundle to $TESTTMP/a5/.hg/strip-backup/*-backup.hg (glob) | |
229 |
|
214 | |||
230 | $ hg tglog |
|
215 | $ hg tglog | |
231 |
@ |
|
216 | @ 8: 'D' | |
232 | | |
|
217 | | | |
233 |
o |
|
218 | o 7: 'C' | |
|
219 | | | |||
|
220 | o 6: 'B' | |||
234 | | |
|
221 | | | |
235 |
o 5: ' |
|
222 | | o 5: 'I' | |
236 | | |
|
223 | | | | |
237 |
| o 4: ' |
|
224 | | o 4: 'H' | |
|
225 | | | | |||
|
226 | o | 3: 'G' | |||
|
227 | |\| | |||
|
228 | | o 2: 'F' | |||
|
229 | | | | |||
|
230 | o | 1: 'E' | |||
238 | |/ |
|
231 | |/ | |
239 |
o |
|
232 | o 0: 'A' | |
240 | | |
|
|||
241 | o 2: 'c3' |
|
|||
242 | | |
|
|||
243 | o 1: 'c2' |
|
|||
244 | | |
|
|||
245 | o 0: 'c1' |
|
|||
246 |
|
233 | |||
247 | $ cd .. |
|
234 | $ cd .. | |
248 |
|
235 | |||
249 |
|
236 | |||
250 |
Specify only base (from |
|
237 | Specify only base (from 1 onto 8): | |
251 |
|
238 | |||
252 | $ hg clone -q -u . a a6 |
|
239 | $ hg clone -q -u . a a6 | |
253 | $ cd a6 |
|
240 | $ cd a6 | |
254 |
|
241 | |||
255 |
$ hg rebase --base |
|
242 | $ hg rebase --base 3 | |
256 | saved backup bundle to $TESTTMP/a6/.hg/strip-backup/*-backup.hg (glob) |
|
243 | saved backup bundle to $TESTTMP/a6/.hg/strip-backup/*-backup.hg (glob) | |
257 |
|
244 | |||
258 | $ hg tglog |
|
245 | $ hg tglog | |
259 |
@ |
|
246 | @ 8: 'D' | |
260 | | |
|
247 | | | |
261 |
o |
|
248 | o 7: 'C' | |
262 | | |
|
249 | | | |
263 |
o |
|
250 | o 6: 'B' | |
264 | | |
|
251 | | | |
265 |
o |
|
252 | o 5: 'I' | |
266 | | |
|
253 | | | |
267 |
o |
|
254 | o 4: 'H' | |
268 | | |
|
|||
269 | o 2: 'c3' |
|
|||
270 | | |
|
255 | | | |
271 |
o |
|
256 | | o 3: 'G' | |
272 | | |
|
257 | |/| | |
273 |
o |
|
258 | o | 2: 'F' | |
|
259 | | | | |||
|
260 | | o 1: 'E' | |||
|
261 | |/ | |||
|
262 | o 0: 'A' | |||
274 |
|
263 | |||
275 | $ cd .. |
|
264 | $ cd .. | |
276 |
|
265 | |||
277 |
|
266 | |||
278 |
Specify source and dest (from |
|
267 | Specify source and dest (from 2 onto 7): | |
279 |
|
268 | |||
280 | $ hg clone -q -u . a a7 |
|
269 | $ hg clone -q -u . a a7 | |
281 | $ cd a7 |
|
270 | $ cd a7 | |
282 |
|
271 | |||
283 |
$ hg rebase --source |
|
272 | $ hg rebase --detach --source 2 --dest 7 | |
284 | saved backup bundle to $TESTTMP/a7/.hg/strip-backup/*-backup.hg (glob) |
|
273 | saved backup bundle to $TESTTMP/a7/.hg/strip-backup/*-backup.hg (glob) | |
285 |
|
274 | |||
286 | $ hg tglog |
|
275 | $ hg tglog | |
287 |
@ |
|
276 | @ 8: 'D' | |
|
277 | | | |||
|
278 | o 7: 'C' | |||
288 | | |
|
279 | | | |
289 |
o |
|
280 | | o 6: 'I' | |
290 |
| |
|
281 | |/ | |
291 |
|
|
282 | o 5: 'H' | |
292 |
| |
|
283 | | | |
293 |
| o 4: ' |
|
284 | | o 4: 'G' | |
|
285 | |/| | |||
|
286 | o | 3: 'F' | |||
294 | | | |
|
287 | | | | |
295 |
o |
|
288 | | o 2: 'E' | |
296 | | | |
|
|||
297 | | o 2: 'c3' |
|
|||
298 | |/ |
|
289 | |/ | |
299 |
o 1: ' |
|
290 | | o 1: 'B' | |
300 | | |
|
291 | |/ | |
301 |
o 0: ' |
|
292 | o 0: 'A' | |
302 |
|
293 | |||
303 | $ cd .. |
|
294 | $ cd .. | |
304 |
|
295 | |||
305 |
|
296 | |||
306 |
Specify base and dest (from |
|
297 | Specify base and dest (from 1 onto 7): | |
307 |
|
298 | |||
308 | $ hg clone -q -u . a a8 |
|
299 | $ hg clone -q -u . a a8 | |
309 | $ cd a8 |
|
300 | $ cd a8 | |
310 |
|
301 | |||
311 |
$ hg rebase --base |
|
302 | $ hg rebase --base 3 --dest 7 | |
312 | saved backup bundle to $TESTTMP/a8/.hg/strip-backup/*-backup.hg (glob) |
|
303 | saved backup bundle to $TESTTMP/a8/.hg/strip-backup/*-backup.hg (glob) | |
313 |
|
304 | |||
314 | $ hg tglog |
|
305 | $ hg tglog | |
315 |
@ |
|
306 | @ 8: 'D' | |
316 | | |
|
307 | | | |
317 |
o |
|
308 | o 7: 'C' | |
318 | | |
|
309 | | | |
319 |
o |
|
310 | o 6: 'B' | |
320 | | |
|
311 | | | |
321 |
| o |
|
312 | | o 5: 'I' | |
322 | |/ |
|
313 | |/ | |
323 |
o |
|
314 | o 4: 'H' | |
324 | | |
|
|||
325 | o 2: 'c3' |
|
|||
326 | | |
|
315 | | | |
327 |
o |
|
316 | | o 3: 'G' | |
328 | | |
|
317 | |/| | |
329 |
o |
|
318 | o | 2: 'F' | |
|
319 | | | | |||
|
320 | | o 1: 'E' | |||
|
321 | |/ | |||
|
322 | o 0: 'A' | |||
330 |
|
323 | |||
331 | $ cd .. |
|
324 | $ cd .. | |
332 |
|
325 | |||
333 | Test --tool parameter: |
|
326 | Test --tool parameter: | |
334 |
|
327 | |||
335 | $ hg init b |
|
328 | $ hg init b | |
336 | $ cd b |
|
329 | $ cd b | |
337 |
|
330 | |||
338 | $ echo c1 > c1 |
|
331 | $ echo c1 > c1 | |
339 | $ hg ci -Am c1 |
|
332 | $ hg ci -Am c1 | |
340 | adding c1 |
|
333 | adding c1 | |
341 |
|
334 | |||
342 | $ echo c2 > c2 |
|
335 | $ echo c2 > c2 | |
343 | $ hg ci -Am c2 |
|
336 | $ hg ci -Am c2 | |
344 | adding c2 |
|
337 | adding c2 | |
345 |
|
338 | |||
346 | $ hg up -q 0 |
|
339 | $ hg up -q 0 | |
347 | $ echo c2b > c2 |
|
340 | $ echo c2b > c2 | |
348 | $ hg ci -Am c2b |
|
341 | $ hg ci -Am c2b | |
349 | adding c2 |
|
342 | adding c2 | |
350 | created new head |
|
343 | created new head | |
351 |
|
344 | |||
352 | $ cd .. |
|
345 | $ cd .. | |
353 |
|
346 | |||
354 | $ hg clone -q -u . b b1 |
|
347 | $ hg clone -q -u . b b1 | |
355 | $ cd b1 |
|
348 | $ cd b1 | |
356 |
|
349 | |||
357 | $ hg rebase -s 2 -d 1 --tool internal:local |
|
350 | $ hg rebase -s 2 -d 1 --tool internal:local | |
358 | saved backup bundle to $TESTTMP/b1/.hg/strip-backup/*-backup.hg (glob) |
|
351 | saved backup bundle to $TESTTMP/b1/.hg/strip-backup/*-backup.hg (glob) | |
359 |
|
352 | |||
360 | $ hg cat c2 |
|
353 | $ hg cat c2 | |
361 | c2 |
|
354 | c2 | |
362 |
|
355 | |||
363 | $ cd .. |
|
356 | $ cd .. | |
364 |
|
357 | |||
365 |
|
358 | |||
366 | $ hg clone -q -u . b b2 |
|
359 | $ hg clone -q -u . b b2 | |
367 | $ cd b2 |
|
360 | $ cd b2 | |
368 |
|
361 | |||
369 | $ hg rebase -s 2 -d 1 --tool internal:other |
|
362 | $ hg rebase -s 2 -d 1 --tool internal:other | |
370 | saved backup bundle to $TESTTMP/b2/.hg/strip-backup/*-backup.hg (glob) |
|
363 | saved backup bundle to $TESTTMP/b2/.hg/strip-backup/*-backup.hg (glob) | |
371 |
|
364 | |||
372 | $ hg cat c2 |
|
365 | $ hg cat c2 | |
373 | c2b |
|
366 | c2b | |
374 |
|
367 | |||
375 | $ cd .. |
|
368 | $ cd .. | |
376 |
|
369 | |||
377 |
|
370 | |||
378 | $ hg clone -q -u . b b3 |
|
371 | $ hg clone -q -u . b b3 | |
379 | $ cd b3 |
|
372 | $ cd b3 | |
380 |
|
373 | |||
381 | $ hg rebase -s 2 -d 1 --tool internal:fail |
|
374 | $ hg rebase -s 2 -d 1 --tool internal:fail | |
382 | abort: unresolved conflicts (see hg resolve, then hg rebase --continue) |
|
375 | abort: unresolved conflicts (see hg resolve, then hg rebase --continue) | |
383 | [255] |
|
376 | [255] | |
384 |
|
377 | |||
385 | $ hg resolve -l |
|
378 | $ hg resolve -l | |
386 | U c2 |
|
379 | U c2 | |
387 |
|
380 | |||
388 | $ hg resolve -m c2 |
|
381 | $ hg resolve -m c2 | |
389 | $ hg rebase -c --tool internal:fail |
|
382 | $ hg rebase -c --tool internal:fail | |
390 | tool option will be ignored |
|
383 | tool option will be ignored | |
391 | saved backup bundle to $TESTTMP/b3/.hg/strip-backup/*-backup.hg (glob) |
|
384 | saved backup bundle to $TESTTMP/b3/.hg/strip-backup/*-backup.hg (glob) | |
392 |
|
385 |
General Comments 0
You need to be logged in to leave comments.
Login now