identify: rename 'changed' keyword -> 'dirty'
authorMatt Harbison <matt_harbison@yahoo.com>
Sun, 25 Jun 2017 17:46:35 -0400
changeset 33054 a49ab7f5e7e7
parent 33053 ef46d432e2e4
child 33055 be3584712b20
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.
mercurial/commands.py
tests/test-identify.t
tests/test-merge-default.t
--- a/mercurial/commands.py	Sat Jun 24 02:39:21 2017 +0900
+++ b/mercurial/commands.py	Sun Jun 25 17:46:35 2017 -0400
@@ -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))
--- a/tests/test-identify.t	Sat Jun 24 02:39:21 2017 +0900
+++ b/tests/test-identify.t	Sun Jun 25 17:46:35 2017 -0400
@@ -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}],
--- a/tests/test-merge-default.t	Sat Jun 24 02:39:21 2017 +0900
+++ b/tests/test-merge-default.t	Sun Jun 25 17:46:35 2017 -0400
@@ -54,7 +54,7 @@
    {
     "bookmarks": [],
     "branch": "default",
-    "changed": "+",
+    "dirty": "+",
     "id": "f25cbe84d8b3+2d95304fed5d+",
     "node": "ffffffffffffffffffffffffffffffffffffffff",
     "p1": [{"node": "f25cbe84d8b320e298e7703f18a25a3959518c23", "rev": 4}],