changeset 48835:020378f32d57 stable

debuglock: ignore ENOENT error when unlocking This is consistent with the main `lock.release` code. Differential Revision: https://phab.mercurial-scm.org/D12481
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 06 Apr 2022 18:39:15 +0200
parents c827bb7b5806
children e31bba4c1be3
files mercurial/debugcommands.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/debugcommands.py	Wed Apr 06 18:50:20 2022 +0200
+++ b/mercurial/debugcommands.py	Wed Apr 06 18:39:15 2022 +0200
@@ -2148,9 +2148,9 @@
     """
 
     if opts.get('force_free_lock'):
-        repo.svfs.unlink(b'lock')
+        repo.svfs.tryunlink(b'lock')
     if opts.get('force_free_wlock'):
-        repo.vfs.unlink(b'wlock')
+        repo.vfs.tryunlink(b'wlock')
     if opts.get('force_free_lock') or opts.get('force_free_wlock'):
         return 0