# HG changeset patch # User Boris Feld # Date 2018-11-07 18:59:38 # Node ID aca09df32819d8571cd94bf5827b33c604191a8d # Parent db61a18148a4a0cf6ab1dc91b0e61dbd7aaf1516 transaction: display data about why the transaction failed to rollback We saw more of these a while back. Having more data available would be nice. diff --git a/mercurial/transaction.py b/mercurial/transaction.py --- a/mercurial/transaction.py +++ b/mercurial/transaction.py @@ -21,6 +21,9 @@ from . import ( pycompat, util, ) +from .utils import ( + stringutil, +) version = 2 @@ -582,8 +585,10 @@ class transaction(util.transactional): self._vfsmap, self._entries, self._backupentries, False, checkambigfiles=self._checkambigfiles) self._report(_("rollback completed\n")) - except BaseException: + except BaseException as exc: self._report(_("rollback failed - please run hg recover\n")) + self._report(_("(failure reason: %s)\n") + % stringutil.forcebytestr(exc)) finally: self._journal = None self._releasefn(self, False) # notify failure of transaction diff --git a/tests/test-repair-strip.t b/tests/test-repair-strip.t --- a/tests/test-repair-strip.t +++ b/tests/test-repair-strip.t @@ -51,6 +51,7 @@ transaction abort! failed to truncate data/b.i rollback failed - please run hg recover + (failure reason: [Errno 13] Permission denied .hg/store/data/b.i') strip failed, backup bundle abort: Permission denied .hg/store/data/b.i % after update 0, strip 2 @@ -104,6 +105,7 @@ transaction abort! failed to truncate 00manifest.i rollback failed - please run hg recover + (failure reason: [Errno 13] Permission denied .hg/store/00manifest.i') strip failed, backup bundle abort: Permission denied .hg/store/00manifest.i % after update 0, strip 2