diff mercurial/debugcommands.py @ 49048: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 b4bc9c4f925d
children ea98850a136e eaaf4f98c9f1
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