# HG changeset patch # User Sune Foldager # Date 1254989261 -7200 # Node ID b91960aed018b7fbcc9648ec6e823a9b7626f0da # Parent c156bf947e261344eb0852d1156b56107c4b3510 rebase: improve error and debug messages diff -r c156bf947e26 -r b91960aed018 hgext/rebase.py --- a/hgext/rebase.py Sun Oct 11 13:54:19 2009 -0500 +++ b/hgext/rebase.py Thu Oct 08 10:07:41 2009 +0200 @@ -381,9 +381,9 @@ if src: commonbase = repo[src].ancestor(repo[dest]) if commonbase == repo[src]: - raise util.Abort(_('cannot rebase an ancestor')) + raise util.Abort(_('source is ancestor of destination')) if commonbase == repo[dest]: - raise util.Abort(_('cannot rebase a descendant')) + raise util.Abort(_('source is descendant of destination')) source = repo[src].rev() else: if base: @@ -392,12 +392,12 @@ cwd = repo['.'].rev() if cwd == dest: - repo.ui.debug('already working on current\n') + repo.ui.debug('source and destination are the same\n') return None targetancestors = set(repo.changelog.ancestors(dest)) if cwd in targetancestors: - repo.ui.debug('already working on the current branch\n') + repo.ui.debug('source is ancestor of destination\n') return None cwdancestors = set(repo.changelog.ancestors(cwd)) diff -r c156bf947e26 -r b91960aed018 tests/test-rebase-scenario-global.out --- a/tests/test-rebase-scenario-global.out Sun Oct 11 13:54:19 2009 -0500 +++ b/tests/test-rebase-scenario-global.out Thu Oct 08 10:07:41 2009 +0200 @@ -129,8 +129,8 @@ % These will fail % E onto D - rebase onto an ancestor -abort: cannot rebase a descendant +abort: source is descendant of destination % D onto E - rebase onto a descendant -abort: cannot rebase an ancestor +abort: source is ancestor of destination % E onto B - merge revision with both parents not in ancestors of target abort: cannot use revision 4 as base, result would have 3 parents