Patchwork identify: rename 'changed' keyword -> 'dirty'

login
register
mail settings
Submitter Matt Harbison
Date June 25, 2017, 10:59 p.m.
Message ID <a49ab7f5e7e765a94a1d.1498431578@Envy>
Download mbox | patch
Permalink /patch/21715/
State Accepted
Headers show

Comments

Matt Harbison - June 25, 2017, 10:59 p.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1498427195 14400
#      Sun Jun 25 17:46:35 2017 -0400
# Node ID a49ab7f5e7e765a94a1dfab2ee3b1da695789eb6
# Parent  ef46d432e2e4cfecafb1faa4765254bf0650d4ef
identify: rename 'changed' keyword -> 'dirty'

I meant to do this before sending the initial templater support, but forgot.

I'm quite surprised that 'dirty' doesn't occur in more user facing contexts, but
there are a few, like the help for blackbox.  It also more obviously mirrors the
'(clean)' state printed by the summary command.  I also didn't like that it was
just one letter off from {changes} in the {latesttags} sub-keywords, which has a
totally different meaning.
Yuya Nishihara - June 26, 2017, 12:41 a.m.
On Sun, 25 Jun 2017 18:59:38 -0400, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison@yahoo.com>
> # Date 1498427195 14400
> #      Sun Jun 25 17:46:35 2017 -0400
> # Node ID a49ab7f5e7e765a94a1dfab2ee3b1da695789eb6
> # Parent  ef46d432e2e4cfecafb1faa4765254bf0650d4ef
> identify: rename 'changed' keyword -> 'dirty'

Queued, thanks.

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2775,20 +2775,20 @@ 
             for p in parents:
                 taglist.extend(p.tags())
 
-            changed = ""
+            dirty = ""
             if (any(repo.status())
                 or any(ctx.sub(s).dirty() for s in ctx.substate)):
-                changed = '+'
-            fm.data(changed=changed)
+                dirty = '+'
+            fm.data(dirty=dirty)
 
             hexoutput = [hexfunc(p.node()) for p in parents]
             if default or id:
-                output = ["%s%s" % ('+'.join(hexoutput), changed)]
-            fm.data(id="%s%s" % ('+'.join(hexoutput), changed))
+                output = ["%s%s" % ('+'.join(hexoutput), dirty)]
+            fm.data(id="%s%s" % ('+'.join(hexoutput), dirty))
 
             if num:
                 numoutput = ["%d" % p.rev() for p in parents]
-                output.append("%s%s" % ('+'.join(numoutput), changed))
+                output.append("%s%s" % ('+'.join(numoutput), dirty))
 
             for i, p in enumerate(parents):
                 fn = fm.nested('p%d' % (i + 1))
diff --git a/tests/test-identify.t b/tests/test-identify.t
--- a/tests/test-identify.t
+++ b/tests/test-identify.t
@@ -48,7 +48,7 @@ 
    {
     "bookmarks": [],
     "branch": "default",
-    "changed": "",
+    "dirty": "",
     "id": "cb9a9f314b8b",
     "node": "ffffffffffffffffffffffffffffffffffffffff",
     "p1": [{"node": "cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b", "rev": 0}],
@@ -66,7 +66,7 @@ 
    {
     "bookmarks": [],
     "branch": "default",
-    "changed": "+",
+    "dirty": "+",
     "id": "cb9a9f314b8b+",
     "node": "ffffffffffffffffffffffffffffffffffffffff",
     "p1": [{"node": "cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b", "rev": 0}],
diff --git a/tests/test-merge-default.t b/tests/test-merge-default.t
--- a/tests/test-merge-default.t
+++ b/tests/test-merge-default.t
@@ -54,7 +54,7 @@ 
    {
     "bookmarks": [],
     "branch": "default",
-    "changed": "+",
+    "dirty": "+",
     "id": "f25cbe84d8b3+2d95304fed5d+",
     "node": "ffffffffffffffffffffffffffffffffffffffff",
     "p1": [{"node": "f25cbe84d8b320e298e7703f18a25a3959518c23", "rev": 4}],