transaction: explain why some recovery failed
authorPierre-Yves David <pierre-yves.david@octobus.net>
Wed, 09 Jun 2021 01:12:03 +0200
changeset 47418 22e21deed474
parent 47417 9ea525216edb
child 47419 0e4e9c1b4cc8
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
mercurial/transaction.py
--- 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: