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