changeset 39701:dea771e63c3c

journal: unify template name for "nodes" (BC) This is a part of the name unification. https://www.mercurial-scm.org/wiki/GenericTemplatingPlan#Dictionary .. bc:: ``{oldhashes}`` and ``{newhashes}`` in journal template are renamed to ``{oldnodes}`` and ``{newnodes}`` respectively.
author Yuya Nishihara <yuya@tcha.org>
date Mon, 03 Sep 2018 07:48:43 +0900
parents b10d145837bc
children a7b91509776d
files hgext/journal.py tests/test-journal.t
diffstat 2 files changed, 15 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/journal.py	Wed Sep 12 15:59:26 2018 -0700
+++ b/hgext/journal.py	Mon Sep 03 07:48:43 2018 +0900
@@ -497,8 +497,8 @@
                                      name='node', sep=',')
 
         fm.startitem()
-        fm.condwrite(ui.verbose, 'oldhashes', '%s -> ', oldhashesstr)
-        fm.write('newhashes', '%s', newhashesstr)
+        fm.condwrite(ui.verbose, 'oldnodes', '%s -> ', oldhashesstr)
+        fm.write('newnodes', '%s', newhashesstr)
         fm.condwrite(ui.verbose, 'user', ' %-8s', entry.user)
         fm.condwrite(
             opts.get('all') or name.startswith('re:'),
--- a/tests/test-journal.t	Wed Sep 12 15:59:26 2018 -0700
+++ b/tests/test-journal.t	Mon Sep 03 07:48:43 2018 +0900
@@ -149,44 +149,44 @@
     "command": "up",
     "date": [5, 0],
     "name": ".",
-    "newhashes": ["1e6c11564562b4ed919baca798bc4338bd299d6a"],
-    "oldhashes": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"],
+    "newnodes": ["1e6c11564562b4ed919baca798bc4338bd299d6a"],
+    "oldnodes": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"],
     "user": "foobar"
    },
    {
     "command": "up 0",
     "date": [2, 0],
     "name": ".",
-    "newhashes": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"],
-    "oldhashes": ["1e6c11564562b4ed919baca798bc4338bd299d6a"],
+    "newnodes": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"],
+    "oldnodes": ["1e6c11564562b4ed919baca798bc4338bd299d6a"],
     "user": "foobar"
    },
    {
     "command": "commit -Aqm b",
     "date": [1, 0],
     "name": ".",
-    "newhashes": ["1e6c11564562b4ed919baca798bc4338bd299d6a"],
-    "oldhashes": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"],
+    "newnodes": ["1e6c11564562b4ed919baca798bc4338bd299d6a"],
+    "oldnodes": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"],
     "user": "foobar"
    },
    {
     "command": "commit -Aqm a",
     "date": [0, 0],
     "name": ".",
-    "newhashes": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"],
-    "oldhashes": ["0000000000000000000000000000000000000000"],
+    "newnodes": ["cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b"],
+    "oldnodes": ["0000000000000000000000000000000000000000"],
     "user": "foobar"
    }
   ]
 
   $ cat <<EOF >> $HGRCPATH
   > [templates]
-  > j = "{oldhashes % '{node|upper}'} -> {newhashes % '{node|upper}'}
+  > j = "{oldnodes % '{node|upper}'} -> {newnodes % '{node|upper}'}
   >      - user: {user}
   >      - command: {command}
   >      - date: {date|rfc3339date}
-  >      - newhashes: {newhashes}
-  >      - oldhashes: {oldhashes}
+  >      - newnodes: {newnodes}
+  >      - oldnodes: {oldnodes}
   >      "
   > EOF
   $ hg journal -Tj -l1
@@ -195,8 +195,8 @@
   - user: foobar
   - command: up
   - date: 1970-01-01T00:00:05+00:00
-  - newhashes: 1e6c11564562b4ed919baca798bc4338bd299d6a
-  - oldhashes: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
+  - newnodes: 1e6c11564562b4ed919baca798bc4338bd299d6a
+  - oldnodes: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
 
   $ hg journal --commit
   previous locations of '.':