D7595: status: outputting structured unfinished-operation information
rdamazio (Rodrigo Damazio Bovendorp)
phabricator at mercurial-scm.org
Thu Dec 12 12:29:42 EST 2019
rdamazio updated this revision to Diff 18638.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D7595?vs=18625&id=18638
BRANCH
default
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D7595/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D7595
AFFECTED FILES
mercurial/cmdutil.py
mercurial/commands.py
tests/test-conflict.t
tests/test-status.t
CHANGE DETAILS
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'
},
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/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/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -793,6 +793,10 @@
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
To: rdamazio, #hg-reviewers, pulkit
Cc: durin42, pulkit, yuja, mercurial-devel
More information about the Mercurial-devel
mailing list