# HG changeset patch # User Boris Feld # Date 1541617178 -3600 # 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 -r db61a18148a4 -r aca09df32819 mercurial/transaction.py --- a/mercurial/transaction.py Sat Nov 10 12:07:26 2018 +0900 +++ b/mercurial/transaction.py Wed Nov 07 19:59:38 2018 +0100 @@ -21,6 +21,9 @@ pycompat, util, ) +from .utils import ( + stringutil, +) version = 2 @@ -582,8 +585,10 @@ 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 -r db61a18148a4 -r aca09df32819 tests/test-repair-strip.t --- a/tests/test-repair-strip.t Sat Nov 10 12:07:26 2018 +0900 +++ b/tests/test-repair-strip.t Wed Nov 07 19:59:38 2018 +0100 @@ -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