changeset 46077:7a2b67e6b680

status: disable morestatus when using -0 Without this patch, you get something like this: ``` M a\x00? a.orig\x00# The repository is in an unfinished *merge* state. (esc) # Unresolved merge conflicts: # # a # # To mark files as resolved: hg resolve --mark FILE # To continue: hg commit # To abort: hg merge --abort ``` That doesn't seem like something one would ever want. I considered making it an error to combine `-0` with morestatus, but it seems very likely that that would just make the user spend time trying to figure out how to disable morestatus, so it feels like we might as well just do it for them. Differential Revision: https://phab.mercurial-scm.org/D9545
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 08 Dec 2020 13:33:40 -0800
parents 0e5065b6baa0
children c581b9ee22b1
files mercurial/commands.py tests/test-conflict.t
diffstat 2 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Sun Dec 06 14:45:19 2020 +0100
+++ b/mercurial/commands.py	Tue Dec 08 13:33:40 2020 -0800
@@ -6766,8 +6766,10 @@
 
     morestatus = None
     if (
-        ui.verbose or ui.configbool(b'commands', b'status.verbose')
-    ) and not ui.plain():
+        (ui.verbose or ui.configbool(b'commands', b'status.verbose'))
+        and not ui.plain()
+        and not opts.get(b'print0')
+    ):
         morestatus = cmdutil.readmorestatus(repo)
 
     ui.pager(b'status')
--- a/tests/test-conflict.t	Sun Dec 06 14:45:19 2020 +0100
+++ b/tests/test-conflict.t	Tue Dec 08 13:33:40 2020 -0800
@@ -80,6 +80,8 @@
    }
   ]
 
+  $ hg status -0
+  M a\x00? a.orig\x00 (no-eol) (esc)
   $ cat a
   Small Mathematical Series.
   1