diff hgext/evolve.py @ 1739:904ae1b2087b stable

split: avoid trying to split an empty commit (issue5191)
author Philippe Pepiot <philippe.pepiot@logilab.fr>
date Sat, 08 Oct 2016 15:49:12 +0200
parents 8f902ec9ed9a
children 8c05184672ae
line wrap: on
line diff
--- a/hgext/evolve.py	Mon Sep 12 10:41:00 2016 -0700
+++ b/hgext/evolve.py	Sat Oct 08 15:49:12 2016 +0200
@@ -2940,11 +2940,12 @@
             else:
                 ui.status(_("no more change to split\n"))
 
-        tip = repo[newcommits[-1]]
-        bmupdate(tip.node())
-        if bookactive is not None:
-            bmactivate(repo, bookactive)
-        obsolete.createmarkers(repo, [(repo[r], newcommits)])
+        if newcommits:
+            tip = repo[newcommits[-1]]
+            bmupdate(tip.node())
+            if bookactive is not None:
+                bmactivate(repo, bookactive)
+            obsolete.createmarkers(repo, [(repo[r], newcommits)])
         tr.close()
     finally:
         lockmod.release(tr, lock, wlock)