debuglock: ignore ENOENT error when unlocking stable
authorPierre-Yves David <pierre-yves.david@octobus.net>
Wed, 06 Apr 2022 18:39:15 +0200
branchstable
changeset 49048 020378f32d57
parent 49047 c827bb7b5806
child 49049 e31bba4c1be3
debuglock: ignore ENOENT error when unlocking This is consistent with the main `lock.release` code. Differential Revision: https://phab.mercurial-scm.org/D12481
mercurial/debugcommands.py
--- 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