[PATCH 1 of 2] rebase: improve error and debug messages

Sune Foldager cryo at cyanite.org
Thu Oct 8 04:06:58 CDT 2009


# HG changeset patch
# User Sune Foldager <cryo at cyanite.org>
# Date 1254989261 -7200
# Node ID bb4c250d4f4c6df5e0601d9983b19c640ddfb1a0
# Parent  4333b97444193012ed5eaea1a6c69b4209b5f248
rebase: improve error and debug messages

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -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 --git a/tests/test-rebase-scenario-global.out b/tests/test-rebase-scenario-global.out
--- a/tests/test-rebase-scenario-global.out
+++ b/tests/test-rebase-scenario-global.out
@@ -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


More information about the Mercurial-devel mailing list