Show More
@@ -536,11 +536,14 b' def buildstate(repo, dest, src, base, de' | |||
|
536 | 536 | |
|
537 | 537 | if src: |
|
538 | 538 | commonbase = repo[src].ancestor(repo[dest]) |
|
539 | samebranch = repo[src].branch() == repo[dest].branch() | |
|
540 | 539 | if commonbase == repo[src]: |
|
541 | 540 | raise util.Abort(_('source is ancestor of destination')) |
|
542 |
if |
|
|
543 | raise util.Abort(_('source is descendant of destination')) | |
|
541 | if commonbase == repo[dest]: | |
|
542 | samebranch = repo[src].branch() == repo[dest].branch() | |
|
543 | if samebranch and repo[src] in repo[dest].children(): | |
|
544 | raise util.Abort(_('source is a child of destination')) | |
|
545 | # rebase on ancestor, force detach | |
|
546 | detach = True | |
|
544 | 547 | source = repo[src].rev() |
|
545 | 548 | if detach: |
|
546 | 549 | # We need to keep track of source's ancestors up to the common base |
@@ -281,3 +281,25 b' Rebasing across null as ancestor' | |||
|
281 | 281 | |/ |
|
282 | 282 | o 0: 'A' |
|
283 | 283 | |
|
284 | ||
|
285 | $ hg rebase -d 5 -s 7 | |
|
286 | saved backup bundle to $TESTTMP/a5/.hg/strip-backup/13547172c9c0-backup.hg | |
|
287 | $ hg tglog | |
|
288 | @ 8: 'D' | |
|
289 | | | |
|
290 | o 7: 'C' | |
|
291 | | | |
|
292 | | o 6: 'B' | |
|
293 | |/ | |
|
294 | o 5: 'extra branch' | |
|
295 | ||
|
296 | o 4: 'H' | |
|
297 | | | |
|
298 | | o 3: 'G' | |
|
299 | |/| | |
|
300 | o | 2: 'F' | |
|
301 | | | | |
|
302 | | o 1: 'E' | |
|
303 | |/ | |
|
304 | o 0: 'A' | |
|
305 |
@@ -51,7 +51,7 b' These fail:' | |||
|
51 | 51 | $ cd a1 |
|
52 | 52 | |
|
53 | 53 | $ hg rebase -s 8 -d 7 |
|
54 |
abort: source is |
|
|
54 | abort: source is a child of destination | |
|
55 | 55 | [255] |
|
56 | 56 | |
|
57 | 57 | $ hg rebase --continue --abort |
@@ -212,7 +212,7 b' G onto F - rebase onto an ancestor:' | |||
|
212 | 212 | $ cd a7 |
|
213 | 213 | |
|
214 | 214 | $ hg rebase -s 6 -d 5 |
|
215 |
abort: source is |
|
|
215 | abort: source is a child of destination | |
|
216 | 216 | [255] |
|
217 | 217 | |
|
218 | 218 | F onto G - rebase onto a descendant: |
@@ -248,3 +248,25 b' F onto G - rebase onto a descendant:' | |||
|
248 | 248 | nothing to rebase |
|
249 | 249 | [1] |
|
250 | 250 | |
|
251 | C onto A - rebase onto an ancestor: | |
|
252 | ||
|
253 | $ hg rebase -d 0 -s 2 | |
|
254 | saved backup bundle to $TESTTMP/a7/.hg/strip-backup/5fddd98957c8-backup.hg | |
|
255 | $ hg tglog | |
|
256 | @ 7: 'D' | |
|
257 | | | |
|
258 | o 6: 'C' | |
|
259 | | | |
|
260 | | o 5: 'H' | |
|
261 | | | | |
|
262 | | | o 4: 'G' | |
|
263 | | |/| | |
|
264 | | o | 3: 'F' | |
|
265 | |/ / | |
|
266 | | o 2: 'E' | |
|
267 | |/ | |
|
268 | | o 1: 'B' | |
|
269 | |/ | |
|
270 | o 0: 'A' | |
|
271 | ||
|
272 |
General Comments 0
You need to be logged in to leave comments.
Login now