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