[PATCH 3 of 3] templatekw: replace currentbookmark with activebookmark keyword

Ryan McElroy rmcelroy at fb.com
Fri May 8 19:56:17 CDT 2015


# HG changeset patch
# User Ryan McElroy <rmcelroy at fb.com>
# Date 1429111176 25200
#      Wed Apr 15 08:19:36 2015 -0700
# Node ID b2df13d3791a1df2d483abc259b069fa88114839
# Parent  d65c8127035c9adc66a9e550c0d9127c0494d397
templatekw: replace currentbookmark with activebookmark keyword

Today, the terms 'active' and 'current' are interchangeably used throughout the
codebase in reference to the active bookmark (the bookmark that will be updated
with the next commit). This leads to confusion among developers and users.
This patch is part of a series to standardize the usage to 'active' throughout
the mercurial codebase and user interface.

diff --git a/mercurial/help/config.txt b/mercurial/help/config.txt
--- a/mercurial/help/config.txt
+++ b/mercurial/help/config.txt
@@ -376,8 +376,8 @@ one shown by default::
         HG: --
         HG: user: {author}\n{ifeq(p2rev, "-1", "",
        "HG: branch merge\n")
-       }HG: branch '{branch}'\n{if(currentbookmark,
-       "HG: bookmark '{currentbookmark}'\n")  }{subrepos %
+       }HG: branch '{branch}'\n{if(activebookmark,
+       "HG: bookmark '{activebookmark}'\n")   }{subrepos %
        "HG: subrepo {subrepo}\n"              }{file_adds %
        "HG: added {file}\n"                   }{file_mods %
        "HG: changed {file}\n"                 }{file_dels %
diff --git a/tests/test-command-template.t b/tests/test-command-template.t
--- a/tests/test-command-template.t
+++ b/tests/test-command-template.t
@@ -2557,12 +2557,12 @@ Test current bookmark templating
   2 bar* foo 
   1 
   0 
-  $ hg log --template "{rev} {currentbookmark}\n"
+  $ hg log --template "{rev} {activebookmark}\n"
   2 bar
   1 
   0 
   $ hg bookmarks --inactive bar
-  $ hg log --template "{rev} {currentbookmark}\n"
+  $ hg log --template "{rev} {activebookmark}\n"
   2 
   1 
   0 
diff --git a/tests/test-commit.t b/tests/test-commit.t
--- a/tests/test-commit.t
+++ b/tests/test-commit.t
@@ -302,7 +302,7 @@ test commit message content
   $ cd commitmsg
   $ echo changed > changed
   $ echo removed > removed
-  $ hg book currentbookmark
+  $ hg book activebookmark
   $ hg ci -qAm init
 
   $ hg rm removed
@@ -317,7 +317,7 @@ test commit message content
   HG: --
   HG: user: test
   HG: branch 'default'
-  HG: bookmark 'currentbookmark'
+  HG: bookmark 'activebookmark'
   HG: added added
   HG: changed changed
   HG: removed removed
@@ -354,7 +354,7 @@ test saving last-message.txt
   HG: --
   HG: user: test
   HG: branch 'default'
-  HG: bookmark 'currentbookmark'
+  HG: bookmark 'activebookmark'
   HG: subrepo sub
   HG: added .hgsub
   HG: added added
@@ -376,22 +376,22 @@ specific template keywords work well
   > [committemplate]
   > changeset.commit.normal = HG: this is "commit.normal" template
   >     HG: {extramsg}
-  >     {if(currentbookmark,
-  >    "HG: bookmark '{currentbookmark}' is activated\n",
+  >     {if(activebookmark,
+  >    "HG: bookmark '{activebookmark}' is activated\n",
   >    "HG: no bookmark is activated\n")}{subrepos %
   >    "HG: subrepo '{subrepo}' is changed\n"}
   > 
   > changeset.commit = HG: this is "commit" template
   >     HG: {extramsg}
-  >     {if(currentbookmark,
-  >    "HG: bookmark '{currentbookmark}' is activated\n",
+  >     {if(activebookmark,
+  >    "HG: bookmark '{activebookmark}' is activated\n",
   >    "HG: no bookmark is activated\n")}{subrepos %
   >    "HG: subrepo '{subrepo}' is changed\n"}
   > 
   > changeset = HG: this is customized commit template
   >     HG: {extramsg}
-  >     {if(currentbookmark,
-  >    "HG: bookmark '{currentbookmark}' is activated\n",
+  >     {if(activebookmark,
+  >    "HG: bookmark '{activebookmark}' is activated\n",
   >    "HG: no bookmark is activated\n")}{subrepos %
   >    "HG: subrepo '{subrepo}' is changed\n"}
   > EOF
@@ -404,7 +404,7 @@ specific template keywords work well
   $ HGEDITOR=cat hg commit -S -q
   HG: this is "commit.normal" template
   HG: Leave message empty to abort commit.
-  HG: bookmark 'currentbookmark' is activated
+  HG: bookmark 'activebookmark' is activated
   HG: subrepo 'sub' is changed
   HG: subrepo 'sub2' is changed
   abort: empty commit message
@@ -416,7 +416,7 @@ specific template keywords work well
   > # now, "changeset.commit" should be chosen for "hg commit"
   > EOF
 
-  $ hg bookmark --inactive currentbookmark
+  $ hg bookmark --inactive activebookmark
   $ hg forget .hgsub
   $ HGEDITOR=cat hg commit -q
   HG: this is "commit" template


More information about the Mercurial-devel mailing list