changeset 46237:bc884e31b8c8

debuglock: rename flag names to better clarity `--force-lock` sounds as if we are taking the lock however in reality it's the opposite. Differential Revision: https://phab.mercurial-scm.org/D9690
author Pulkit Goyal <7895pulkit@gmail.com>
date Fri, 08 Jan 2021 18:07:33 +0530
parents eec47efe219d
children 9796cf108e4e
files mercurial/debugcommands.py relnotes/next tests/test-completion.t
diffstat 3 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/debugcommands.py	Wed Jan 06 18:31:16 2021 +0530
+++ b/mercurial/debugcommands.py	Fri Jan 08 18:07:33 2021 +0530
@@ -1889,10 +1889,10 @@
 @command(
     b'debuglocks',
     [
-        (b'L', b'force-lock', None, _(b'free the store lock (DANGEROUS)')),
+        (b'L', b'force-free-lock', None, _(b'free the store lock (DANGEROUS)')),
         (
             b'W',
-            b'force-wlock',
+            b'force-free-wlock',
             None,
             _(b'free the working state lock (DANGEROUS)'),
         ),
@@ -1931,11 +1931,11 @@
 
     """
 
-    if opts.get('force_lock'):
+    if opts.get('force_free_lock'):
         repo.svfs.unlink(b'lock')
-    if opts.get('force_wlock'):
+    if opts.get('force_free_wlock'):
         repo.vfs.unlink(b'wlock')
-    if opts.get('force_lock') or opts.get('force_wlock'):
+    if opts.get('force_free_lock') or opts.get('force_free_wlock'):
         return 0
 
     locks = []
--- a/relnotes/next	Wed Jan 06 18:31:16 2021 +0530
+++ b/relnotes/next	Fri Jan 08 18:07:33 2021 +0530
@@ -53,6 +53,8 @@
 
 == Backwards Compatibility Changes ==
 
+ * `--force-lock` and `--force-wlock` options on `hg debuglock` command are
+   renamed to `--force-free-lock` and `--force-free-wlock` respectively.
 
 
 == Internal API Changes ==
--- a/tests/test-completion.t	Wed Jan 06 18:31:16 2021 +0530
+++ b/tests/test-completion.t	Fri Jan 08 18:07:33 2021 +0530
@@ -295,7 +295,7 @@
   debuginstall: template
   debugknown: 
   debuglabelcomplete: 
-  debuglocks: force-lock, force-wlock, set-lock, set-wlock
+  debuglocks: force-free-lock, force-free-wlock, set-lock, set-wlock
   debugmanifestfulltextcache: clear, add
   debugmergestate: style, template
   debugnamecomplete: