Mercurial > hg
comparison mercurial/localrepo.py @ 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 | c887bab2dccf |
children | e43e68624dfb |
comparison
equal
deleted
inserted
replaced
47420:e7ad2490d623 | 47421:d2e0226b511a |
---|---|
3443 # leaving both src and dest on disk. delete dest to make sure | 3443 # leaving both src and dest on disk. delete dest to make sure |
3444 # the rename couldn't be such a no-op. | 3444 # the rename couldn't be such a no-op. |
3445 vfs.tryunlink(dest) | 3445 vfs.tryunlink(dest) |
3446 try: | 3446 try: |
3447 vfs.rename(src, dest) | 3447 vfs.rename(src, dest) |
3448 except OSError: # journal file does not yet exist | 3448 except OSError as exc: # journal file does not yet exist |
3449 pass | 3449 if exc.errno != errno.ENOENT: |
3450 raise | |
3450 | 3451 |
3451 return a | 3452 return a |
3452 | 3453 |
3453 | 3454 |
3454 def undoname(fn): | 3455 def undoname(fn): |