equal
deleted
inserted
replaced
480 [s.node for s in repo.mq.applied]): |
480 [s.node for s in repo.mq.applied]): |
481 raise util.Abort(_('cannot rebase onto an applied mq patch')) |
481 raise util.Abort(_('cannot rebase onto an applied mq patch')) |
482 |
482 |
483 if src: |
483 if src: |
484 commonbase = repo[src].ancestor(repo[dest]) |
484 commonbase = repo[src].ancestor(repo[dest]) |
|
485 samebranch = repo[src].branch() == repo[dest].branch() |
485 if commonbase == repo[src]: |
486 if commonbase == repo[src]: |
486 raise util.Abort(_('source is ancestor of destination')) |
487 raise util.Abort(_('source is ancestor of destination')) |
487 if commonbase == repo[dest]: |
488 if samebranch and commonbase == repo[dest]: |
488 raise util.Abort(_('source is descendant of destination')) |
489 raise util.Abort(_('source is descendant of destination')) |
489 source = repo[src].rev() |
490 source = repo[src].rev() |
490 if detach: |
491 if detach: |
491 # We need to keep track of source's ancestors up to the common base |
492 # We need to keep track of source's ancestors up to the common base |
492 srcancestors = set(repo.changelog.ancestors(source)) |
493 srcancestors = set(repo.changelog.ancestors(source)) |