# HG changeset patch # User Martin von Zweigbergk # Date 2022-09-22 23:50:30 # Node ID f2b1bc19ce90c36fca6be892479d31a6a212de90 # Parent 1baf0fffd82fb7624e310593f8a19cfb99c622ba status: let `--no-copies` override `ui.statuscopies` diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -6980,11 +6980,13 @@ def status(ui, repo, *pats, **opts): ) 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 diff --git a/tests/test-status.t b/tests/test-status.t --- a/tests/test-status.t +++ b/tests/test-status.t @@ -637,9 +637,16 @@ using ui.statuscopies setting 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