# HG changeset patch # User Pierre-Yves David # Date 2021-06-08 22:59:04 # Node ID d2e0226b511a0ae37a4b315793f4ee3412e02cba # Parent e7ad2490d62399a0af1fe0b7cb2dbdbff4e91748 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 diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -3445,8 +3445,9 @@ def aftertrans(files): 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