# HG changeset patch # User Rodrigo Damazio Bovendorp # Date 2019-12-10 06:06:55 # Node ID 7315464f0613c2bcc75a415ac117d114e653ebe4 # Parent fb4a6d5847569f18efd22e82f4ead4d26a8fac43 status: add template/json data about whether a file has unresolved conflicts Differential Revision: https://phab.mercurial-scm.org/D7594 diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -788,6 +788,10 @@ class morestatus(object): 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 diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -6893,6 +6893,8 @@ def status(ui, repo, *pats, **opts): (b' %s' + end) % uipathfn(copy[f]), label=b'status.copied', ) + if morestatus: + morestatus.formatfile(f, fm) if morestatus: morestatus.formatfooter(fm) diff --git a/tests/test-conflict.t b/tests/test-conflict.t --- a/tests/test-conflict.t +++ b/tests/test-conflict.t @@ -64,7 +64,8 @@ [ { "path": "a", - "status": "M" + "status": "M", + "unresolved": true }, { "path": "a.orig",