[Request] [+ ] D10842: transaction: explain why some recovery failed
marmoute (Pierre-Yves David)
phabricator at mercurial-scm.org
Wed Jun 9 14:37:14 UTC 2021
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.
REVISION SUMMARY
Right now we issue a message about failing to recover some file, but not why.
It seems useful to add some information about that.
(This is an opportunity improvement while looking at something next to that.)
REPOSITORY
rHG Mercurial
BRANCH
default
REVISION DETAIL
https://phab.mercurial-scm.org/D10842
AFFECTED FILES
mercurial/transaction.py
CHANGE DETAILS
diff --git a/mercurial/transaction.py b/mercurial/transaction.py
--- a/mercurial/transaction.py
+++ b/mercurial/transaction.py
@@ -94,8 +94,9 @@
try:
util.copyfile(backuppath, filepath, checkambig=checkambig)
backupfiles.append(b)
- except IOError:
- report(_(b"failed to recover %s\n") % f)
+ except IOError as exc:
+ e_msg = stringutil.forcebytestr(exc)
+ report(_(b"failed to recover %s (%s)\n") % (f, e_msg))
else:
target = f or b
try:
To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20210609/76645d30/attachment.html>
More information about the Mercurial-patches
mailing list