changeset 47418:22e21deed474

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
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 09 Jun 2021 01:12:03 +0200
parents 9ea525216edb
children 0e4e9c1b4cc8
files mercurial/transaction.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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: