marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This is consistent with the main `lock.release` code.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

REVISION DETAIL
  https://phab.mercurial-scm.org/D12481

AFFECTED FILES
  mercurial/debugcommands.py

CHANGE DETAILS

diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -2148,9 +2148,17 @@
     """
 
     if opts.get('force_free_lock'):
-        repo.svfs.unlink(b'lock')
+        try:
+            repo.svfs.unlink(b'lock')
+        except (OSError, IOError) as e:
+            if e.errno != errno.ENOENT:
+                raise
     if opts.get('force_free_wlock'):
-        repo.vfs.unlink(b'wlock')
+        try:
+            repo.vfs.unlink(b'wlock')
+        except (OSError, IOError) as e:
+            if e.errno != errno.ENOENT:
+                raise
     if opts.get('force_free_lock') or opts.get('force_free_wlock'):
         return 0
 



To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to