Patchwork D10842: transaction: explain why some recovery failed

login
register
mail settings
Submitter phabricator
Date June 9, 2021, 2:37 p.m.
Message ID <differential-rev-PHID-DREV-nxzymqqbqrsr7kxdqjb2-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49162/
State Superseded
Headers show

Comments

phabricator - June 9, 2021, 2:37 p.m.
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




To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

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: