status: let `--no-copies` override `ui.statuscopies`
authorMartin von Zweigbergk <martinvonz@google.com>
Thu, 22 Sep 2022 16:50:30 -0700
changeset 49498 f2b1bc19ce90
parent 49497 1baf0fffd82f
child 49499 4f36738a869a
status: let `--no-copies` override `ui.statuscopies`
mercurial/commands.py
tests/test-status.t
--- a/mercurial/commands.py	Thu Sep 22 01:50:53 2022 +0200
+++ b/mercurial/commands.py	Thu Sep 22 16:50:30 2022 -0700
@@ -6980,11 +6980,13 @@
     )
 
     copy = {}
-    if (
-        opts.get(b'all')
-        or opts.get(b'copies')
-        or ui.configbool(b'ui', b'statuscopies')
-    ) and not opts.get(b'no_status'):
+    show_copies = ui.configbool(b'ui', b'statuscopies')
+    if opts.get(b'copies') is not None:
+        show_copies = opts.get(b'copies')
+    show_copies = (show_copies or opts.get(b'all')) and not opts.get(
+        b'no_status'
+    )
+    if show_copies:
         copy = copies.pathcopies(ctx1, ctx2, m)
 
     morestatus = None
--- a/tests/test-status.t	Thu Sep 22 01:50:53 2022 +0200
+++ b/tests/test-status.t	Thu Sep 22 16:50:30 2022 -0700
@@ -637,9 +637,16 @@
   M a
     b
   R b
+  $ hg st --config ui.statuscopies=true --no-copies
+  M a
+  R b
   $ hg st --config ui.statuscopies=false
   M a
   R b
+  $ hg st --config ui.statuscopies=false --copies
+  M a
+    b
+  R b
   $ hg st --config ui.tweakdefaults=yes
   M a
     b