rebase: improve error and debug messages
authorSune Foldager <cryo@cyanite.org>
Thu, 08 Oct 2009 10:07:41 +0200
changeset 9577 b91960aed018
parent 9576 c156bf947e26
child 9578 341182ac95e4
rebase: improve error and debug messages
hgext/rebase.py
tests/test-rebase-scenario-global.out
--- 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))
--- 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