comparison hgext/rebase.py @ 9578:341182ac95e4

rebase: return early when source is descendant of destination This only happens when using --base (or no source selection options), as rebase already aborts in this situation when using --source. Without this change you get an abort from the underlying merge, and the repository is in a different state than you started with (the working dir parent is changed).
author Sune Foldager <cryo@cyanite.org>
date Thu, 08 Oct 2009 10:39:43 +0200
parents b91960aed018
children f3404b7f37ca
comparison
equal deleted inserted replaced
9577:b91960aed018 9578:341182ac95e4
399 if cwd in targetancestors: 399 if cwd in targetancestors:
400 repo.ui.debug('source is ancestor of destination\n') 400 repo.ui.debug('source is ancestor of destination\n')
401 return None 401 return None
402 402
403 cwdancestors = set(repo.changelog.ancestors(cwd)) 403 cwdancestors = set(repo.changelog.ancestors(cwd))
404 if dest in cwdancestors:
405 repo.ui.debug('source is descendant of destination\n')
406 return None
407
404 cwdancestors.add(cwd) 408 cwdancestors.add(cwd)
405 rebasingbranch = cwdancestors - targetancestors 409 rebasingbranch = cwdancestors - targetancestors
406 source = min(rebasingbranch) 410 source = min(rebasingbranch)
407 411
408 repo.ui.debug('rebase onto %d starting from %d\n' % (dest, source)) 412 repo.ui.debug('rebase onto %d starting from %d\n' % (dest, source))