diff --git a/hgext/transplant.py b/hgext/transplant.py --- a/hgext/transplant.py +++ b/hgext/transplant.py @@ -246,6 +246,15 @@ class transplanter(object): 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)