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

login
register
mail settings
Submitter Ryan McElroy
Date May 7, 2015, 4:41 p.m.
Message ID <6bbfd7ac9dcccca7c95b.1431016875@devbig105.prn2.facebook.com>
Download mbox | patch
Permalink /patch/8946/
State Accepted
Headers show

Comments

Ryan McElroy - May 7, 2015, 4:41 p.m.
# HG changeset patch
# User Ryan McElroy <rmcelroy@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.

Patch

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]