comparison hgext/evolve.py @ 911:3b7dfa9bb789 stable

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 4f84b3307dc2
children 0c1907a65b9f
comparison
equal deleted inserted replaced
910:e911d1da89df 911:3b7dfa9bb789
736 pass 736 pass
737 737
738 def relocate(repo, orig, dest): 738 def relocate(repo, orig, dest):
739 """rewrite <rev> on dest""" 739 """rewrite <rev> on dest"""
740 try: 740 try:
741 if orig.rev() == dest.rev():
742 raise util.Abort(_('tried to relocade a node on top of itself'),
743 hint=_("This shouldn't happen. If you still "
744 "need to move changesets, please do so "
745 "manually with nothing to rebase - working directory parent is also destination"))
746
741 rebase = extensions.find('rebase') 747 rebase = extensions.find('rebase')
742 # dummy state to trick rebase node 748 # dummy state to trick rebase node
743 if not orig.p2().rev() == node.nullrev: 749 if not orig.p2().rev() == node.nullrev:
744 raise util.Abort( 750 raise util.Abort(
745 'no support for evolution merge changesets yet', 751 'no support for evolution merge changesets yet',