raise util.Abort instead of assertion when trying to evolve a merge changeset.
authorArne Babenhauserheide <arne.babenhauserheide@kit.edu>
Mon, 20 Jan 2014 10:57:10 +0100
changeset 776 7eaad1101242
parent 775 0961a7eb82c4
child 787 a9277d11db47
raise util.Abort instead of assertion when trying to evolve a merge changeset. This prevent exposing a nasty traceback to the user.
hgext/evolve.py
--- a/hgext/evolve.py	Thu Jan 09 21:46:23 2014 -0800
+++ b/hgext/evolve.py	Mon Jan 20 10:57:10 2014 +0100
@@ -767,7 +767,10 @@
     try:
         rebase = extensions.find('rebase')
         # dummy state to trick rebase node
-        assert orig.p2().rev() == node.nullrev, 'no support yet'
+        if not orig.p2().rev() == node.nullrev:
+            raise util.Abort(
+                'no support for evolution merge changesets yet',
+                hint="Redo the merge a use `hg prune` to obsolete the old one")
         destbookmarks = repo.nodebookmarks(dest.node())
         cmdutil.duplicatecopies(repo, orig.node(), dest.node())
         nodesrc = orig.node()