# HG changeset patch # User Rodrigo Damazio Bovendorp # Date 1576741511 28800 # Node ID 07ebb567e8bbad39fa148c8e1b8a733286e47995 # Parent 489fdf27769cd18592e88aca2302b6fde867f197 status: make unresolved files always be in the morestatus structured output We don't know the status of those files, only that they're unresolved, so we don't output the status for those - any code parsing this will have to be tolerant to that. Differential Revision: https://phab.mercurial-scm.org/D7668 diff -r 489fdf27769c -r 07ebb567e8bb mercurial/cmdutil.py --- a/mercurial/cmdutil.py Wed Dec 18 23:43:21 2019 -0800 +++ b/mercurial/cmdutil.py Wed Dec 18 23:45:11 2019 -0800 @@ -811,9 +811,11 @@ unfinishedmsg = attr.ib() activemerge = attr.ib() unresolvedpaths = attr.ib() + _formattedpaths = attr.ib(init=False, default=set()) _label = b'status.morestatus' def formatfile(self, path, fm): + self._formattedpaths.add(path) if self.activemerge and path in self.unresolvedpaths: fm.data(unresolved=True) @@ -832,6 +834,7 @@ if self.unfinishedmsg: fm.data(unfinishedmsg=self.unfinishedmsg) + # May also start new data items. self._formatconflicts(fm) if self.unfinishedmsg: @@ -861,6 +864,19 @@ ) % mergeliststr ) + + # If any paths with unresolved conflicts were not previously + # formatted, output them now. + for f in self.unresolvedpaths: + if f in self._formattedpaths: + # Already output. + continue + fm.startitem() + # We can't claim to know the status of the file - it may just + # have been in one of the states that were not requested for + # display, so it could be anything. + fm.data(itemtype=b'file', path=f, unresolved=True) + else: msg = _(b'No unresolved merge conflicts.') diff -r 489fdf27769c -r 07ebb567e8bb tests/test-update-branches.t --- a/tests/test-update-branches.t Wed Dec 18 23:43:21 2019 -0800 +++ b/tests/test-update-branches.t Wed Dec 18 23:45:11 2019 -0800 @@ -591,6 +591,11 @@ "itemtype": "file", "path": "foo", "status": "M" + }, + { + "itemtype": "file", + "path": "a", + "unresolved": true } ]