changeset 43842:7315464f0613

status: add template/json data about whether a file has unresolved conflicts Differential Revision: https://phab.mercurial-scm.org/D7594
author Rodrigo Damazio Bovendorp <rdamazio@google.com>
date Mon, 09 Dec 2019 22:06:55 -0800
parents fb4a6d584756
children d74d78aa74e9
files mercurial/cmdutil.py mercurial/commands.py tests/test-conflict.t
diffstat 3 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Mon Dec 09 18:15:38 2019 -0800
+++ b/mercurial/cmdutil.py	Mon Dec 09 22:06:55 2019 -0800
@@ -788,6 +788,10 @@
     unresolvedpaths = attr.ib()
     _label = b'status.morestatus'
 
+    def formatfile(self, path, fm):
+        if self.inmergestate and path in self.unresolvedpaths:
+            fm.data(unresolved=True)
+
     def formatfooter(self, fm):
         statemsg = _(b'The repository is in an unfinished *%s* state.'
                      ) % self.unfinishedop
--- a/mercurial/commands.py	Mon Dec 09 18:15:38 2019 -0800
+++ b/mercurial/commands.py	Mon Dec 09 22:06:55 2019 -0800
@@ -6893,6 +6893,8 @@
                         (b'  %s' + end) % uipathfn(copy[f]),
                         label=b'status.copied',
                     )
+                if morestatus:
+                    morestatus.formatfile(f, fm)
 
     if morestatus:
         morestatus.formatfooter(fm)
--- a/tests/test-conflict.t	Mon Dec 09 18:15:38 2019 -0800
+++ b/tests/test-conflict.t	Mon Dec 09 22:06:55 2019 -0800
@@ -64,7 +64,8 @@
   [
    {
     "path": "a",
-    "status": "M"
+    "status": "M",
+    "unresolved": true
    },
    {
     "path": "a.orig",