diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -793,6 +793,13 @@ fm.data(unresolved=True) def formatfooter(self, fm): + fm.startitem() + fm.data( + itemtype=b'morestatus', + unfinished=self.unfinishedop, + unfinishedmsg=self.unfinishedmsg, + ) + 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 @@ -6884,7 +6884,7 @@ for f in files: fm.startitem() fm.context(ctx=ctx2) - fm.data(path=f) + fm.data(itemtype=b'file', path=f) fm.condwrite(showchar, b'status', b'%s ', char, label=label) fm.plain(fmt % uipathfn(f), label=label) if f in copy: diff --git a/tests/test-conflict.t b/tests/test-conflict.t --- a/tests/test-conflict.t +++ b/tests/test-conflict.t @@ -63,13 +63,20 @@ $ hg status -Tjson [ { + "itemtype": "file", "path": "a", "status": "M", "unresolved": true }, { + "itemtype": "file", "path": "a.orig", "status": "?" + }, + { + "itemtype": "morestatus", + "unfinished": "merge", + "unfinishedmsg": "To continue: hg commit\nTo abort: hg merge --abort" } ] diff --git a/tests/test-status.t b/tests/test-status.t --- a/tests/test-status.t +++ b/tests/test-status.t @@ -254,35 +254,43 @@ $ hg status -A -Tjson [ { + "itemtype": "file", "path": "added", "status": "A" }, { + "itemtype": "file", "path": "copied", "source": "modified", "status": "A" }, { + "itemtype": "file", "path": "removed", "status": "R" }, { + "itemtype": "file", "path": "deleted", "status": "!" }, { + "itemtype": "file", "path": "unknown", "status": "?" }, { + "itemtype": "file", "path": "ignored", "status": "I" }, { + "itemtype": "file", "path": ".hgignore", "status": "C" }, { + "itemtype": "file", "path": "modified", "status": "C" } @@ -558,6 +566,7 @@ $ hg status --config ui.formatdebug=True --rev 1 1 status = [ { + 'itemtype': 'file', 'path': '1/2/3/4/5/b.txt', 'status': 'R' },