transaction: explain why some recovery failed
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.)
Differential Revision: https://phab.mercurial-scm.org/D10842
--- a/mercurial/transaction.py Mon Jun 07 21:09:31 2021 +0200
+++ b/mercurial/transaction.py Wed Jun 09 01:12:03 2021 +0200
@@ -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: