D9545: status: disable morestatus when using -0

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Tue Dec 8 21:40:40 UTC 2020


martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9545

AFFECTED FILES
  mercurial/commands.py
  tests/test-conflict.t

CHANGE DETAILS

diff --git a/tests/test-conflict.t b/tests/test-conflict.t
--- a/tests/test-conflict.t
+++ b/tests/test-conflict.t
@@ -80,6 +80,8 @@
    }
   ]
 
+  $ hg status -0
+  M a\x00? a.orig\x00 (no-eol) (esc)
   $ cat a
   Small Mathematical Series.
   1
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -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')



To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel


More information about the Mercurial-devel mailing list