hgext/transplant.py
branchstable
changeset 11638 79231258503b
parent 11411 5834e79b24f7
child 12067 a4fbbe0fbc38
--- a/hgext/transplant.py	Tue Jul 20 20:37:29 2010 +0530
+++ b/hgext/transplant.py	Sun Jul 18 21:29:29 2010 -0400
@@ -246,6 +246,15 @@
             m = match.exact(repo.root, '', files)
 
         n = repo.commit(message, user, date, extra=extra, match=m)
+        if not n:
+            # Crash here to prevent an unclear crash later, in
+            # transplants.write().  This can happen if patch.patch()
+            # does nothing but claims success or if repo.status() fails
+            # to report changes done by patch.patch().  These both
+            # appear to be bugs in other parts of Mercurial, but dying
+            # here, as soon as we can detect the problem, is preferable
+            # to silently dropping changesets on the floor.
+            raise RuntimeError('nothing committed after transplant')
         if not merge:
             self.transplants.set(n, node)