changeset 47421:d2e0226b511a

transaction: narrow the error filtering when failing to rename undo file Having inconsistent "undo" files can be quite serious so we narrow the error filtering to the intent that the comment explain. (This is an opportunity improvement while looking at something next to that.) Differential Revision: https://phab.mercurial-scm.org/D10845
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 09 Jun 2021 00:59:04 +0200
parents e7ad2490d623
children 88439c6fbafc
files mercurial/localrepo.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Wed Jun 09 01:13:09 2021 +0200
+++ b/mercurial/localrepo.py	Wed Jun 09 00:59:04 2021 +0200
@@ -3445,8 +3445,9 @@
             vfs.tryunlink(dest)
             try:
                 vfs.rename(src, dest)
-            except OSError:  # journal file does not yet exist
-                pass
+            except OSError as exc:  # journal file does not yet exist
+                if exc.errno != errno.ENOENT:
+                    raise
 
     return a