changeset 52342:53dc147bc8b0

rhg: avoid calculating copies for status --no-status This changes how rhg status avoids printing copies with --no-status. Originally 668a871454e8 added a check right before printing copies. This changes it to match Python and check it earlier by defining `list_copies = ... && !no_status`. This makes no difference now, but when we implement --rev --rev --copies it will ensure we don't do wasteful copy tracing when it's not going to be printed.
author Mitchell Kember <mkember@janestreet.com>
date Mon, 02 Dec 2024 09:45:56 -0500
parents c2814b698df8
children 393ad2685fb4
files rust/rhg/src/commands/status.rs
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/rust/rhg/src/commands/status.rs	Mon Nov 25 15:34:58 2024 -0500
+++ b/rust/rhg/src/commands/status.rs	Mon Dec 02 09:45:56 2024 -0500
@@ -305,7 +305,7 @@
     } else {
         config.get_bool(b"ui", b"statuscopies")?
     };
-    let list_copies = list_copies || all;
+    let list_copies = (list_copies || all) && !no_status;
 
     let repo = invocation.repo?;
     let revpair = parse_revpair(repo, revs.map(|i| i.cloned().collect()))?;
@@ -705,7 +705,7 @@
                 &format_bytes!(b"{}{}", path, linebreak),
                 label,
             )?;
-            if let Some(source) = copy_source.filter(|_| !self.no_status) {
+            if let Some(source) = copy_source {
                 let label = "status.copied";
                 self.ui.write_stdout_labelled(
                     &format_bytes!(b"  {}{}", source, linebreak),