Mercurial > evolve
comparison hgext/evolve.py @ 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 | 097ddcb0da25 |
children | 4f21a3279a60 |
comparison
equal
deleted
inserted
replaced
889:e0eb4899b7c2 | 890:7de15cfd79f7 |
---|---|
792 pass | 792 pass |
793 | 793 |
794 def relocate(repo, orig, dest): | 794 def relocate(repo, orig, dest): |
795 """rewrite <rev> on dest""" | 795 """rewrite <rev> on dest""" |
796 try: | 796 try: |
797 if orig.rev() == dest.rev(): | |
798 raise util.Abort(_('tried to relocade a node on top of itself'), | |
799 hint=_("This shouldn't happen. If you still " | |
800 "need to move changesets, please do so " | |
801 "manually with nothing to rebase - working directory parent is also destination")) | |
802 | |
797 rebase = extensions.find('rebase') | 803 rebase = extensions.find('rebase') |
798 # dummy state to trick rebase node | 804 # dummy state to trick rebase node |
799 if not orig.p2().rev() == node.nullrev: | 805 if not orig.p2().rev() == node.nullrev: |
800 raise util.Abort( | 806 raise util.Abort( |
801 'no support for evolution merge changesets yet', | 807 'no support for evolution merge changesets yet', |