changeset 890:7de15cfd79f7

evolve: abort when trying to move a node on top of itself This provides a clearer error message when evolve misstakenly tries to move a changeset on top of itself. Before we got an abort with a cryptic message about trying to rebase a merge changeset. A proper fix to make sure that evolve never tries to move a node on top of itself will come in later patches.
author Olle Lundberg <geek@nerd.sh>
date Wed, 26 Mar 2014 00:38:14 +0100
parents e0eb4899b7c2
children 4f21a3279a60
files hgext/evolve.py
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/evolve.py	Wed Mar 26 23:57:15 2014 +0100
+++ b/hgext/evolve.py	Wed Mar 26 00:38:14 2014 +0100
@@ -794,6 +794,12 @@
 def relocate(repo, orig, dest):
     """rewrite <rev> on dest"""
     try:
+        if orig.rev() == dest.rev():
+            raise util.Abort(_('tried to relocade a node on top of itself'),
+                             hint=_("This shouldn't happen. If you still "
+                                    "need to move changesets, please do so "
+                                    "manually with nothing to rebase - working directory parent is also destination"))
+
         rebase = extensions.find('rebase')
         # dummy state to trick rebase node
         if not orig.p2().rev() == node.nullrev: