Patchwork [1,of,5,V2] resolve: rename {status} to {mergestatus} to not shadow change status (BC)

login
register
mail settings
Submitter Yuya Nishihara
Date Oct. 1, 2018, 11:15 a.m.
Message ID <ebc28ed2630d95389cd4.1538392536@mimosa>
Download mbox | patch
Permalink /patch/35234/
State New
Headers show

Comments

Yuya Nishihara - Oct. 1, 2018, 11:15 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1538288127 -32400
#      Sun Sep 30 15:15:27 2018 +0900
# Node ID ebc28ed2630d95389cd4bed1325a27dd15686abd
# Parent  f3b65098630f1a9878a657f1163e997fd07c788f
resolve: rename {status} to {mergestatus} to not shadow change status (BC)

This is a part of the name unification. I think it's somewhat useful to
provide a combined view of change/merge statuses.

https://www.mercurial-scm.org/wiki/GenericTemplatingPlan#Dictionary

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -4622,7 +4622,7 @@  def resolve(ui, repo, *pats, **opts):
             label, key = mergestateinfo[ms[f]]
             fm.startitem()
             fm.context(ctx=wctx)
-            fm.condwrite(not nostatus, 'status', '%s ', key, label=label)
+            fm.condwrite(not nostatus, 'mergestatus', '%s ', key, label=label)
             fm.write('path', '%s\n', f, label=label)
         fm.end()
         return 0
diff --git a/tests/test-resolve.t b/tests/test-resolve.t
--- a/tests/test-resolve.t
+++ b/tests/test-resolve.t
@@ -156,18 +156,18 @@  resolve -l should show resolved file as 
   $ hg resolve -l -Tjson
   [
    {
-    "path": "file1",
-    "status": "R"
+    "mergestatus": "R",
+    "path": "file1"
    },
    {
-    "path": "file2",
-    "status": "U"
+    "mergestatus": "U",
+    "path": "file2"
    }
   ]
 
-  $ hg resolve -l -T '{path} {status} {p1rev} {p2rev}\n'
-  file1 R 2 1
-  file2 U 2 1
+  $ hg resolve -l -T '{path} {mergestatus} {status} {p1rev} {p2rev}\n'
+  file1 R M 2 1
+  file2 U M 2 1
 
 resolve -m without paths should mark all resolved