[PATCH 3 of 4 V3] bookmarks: rename readcurrent to readactive (API)

Ryan McElroy rmcelroy at fb.com
Thu May 7 11:41:15 CDT 2015


# HG changeset patch
# User Ryan McElroy <rmcelroy at fb.com>
# Date 1428991393 25200
#      Mon Apr 13 23:03:13 2015 -0700
# Node ID 6bbfd7ac9dcccca7c95b8afec11ad3d2217f8f8d
# Parent  69a4c4d92171181026be6d39e980a187eed6270f
bookmarks: rename readcurrent to readactive (API)

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/bookmarks.py b/mercurial/bookmarks.py
--- a/mercurial/bookmarks.py
+++ b/mercurial/bookmarks.py
@@ -106,13 +106,12 @@ class bmstore(dict):
         for name, node in self.iteritems():
             fp.write("%s %s\n" % (hex(node), encoding.fromlocal(name)))
 
-def readcurrent(repo):
-    '''Get the current bookmark
-
-    If we use gittish branches we have a current bookmark that
-    we are on. This function returns the name of the bookmark. It
-    is stored in .hg/bookmarks.current
-    '''
+def readactive(repo):
+    """
+    Get the active bookmark. We can have an active bookmark that updates
+    itself as we commit. This function returns the name of that bookmark.
+    It is stored in .hg/bookmarks.current
+    """
     mark = None
     try:
         file = repo.vfs('bookmarks.current')
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -419,7 +419,7 @@ class localrepository(object):
 
     @repofilecache('bookmarks.current')
     def _bookmarkcurrent(self):
-        return bookmarks.readcurrent(self)
+        return bookmarks.readactive(self)
 
     def bookmarkheads(self, bookmark):
         name = bookmark.split('@', 1)[0]


More information about the Mercurial-devel mailing list