changeset 24946:c44534209a0a

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.
author Ryan McElroy <rmcelroy@fb.com>
date Mon, 13 Apr 2015 23:03:13 -0700
parents e0b0fbd47491
children a02d293a1079
files mercurial/bookmarks.py mercurial/localrepo.py
diffstat 2 files changed, 7 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/bookmarks.py	Mon Apr 13 22:27:01 2015 -0700
+++ b/mercurial/bookmarks.py	Mon Apr 13 23:03:13 2015 -0700
@@ -106,13 +106,12 @@
         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')
--- a/mercurial/localrepo.py	Mon Apr 13 22:27:01 2015 -0700
+++ b/mercurial/localrepo.py	Mon Apr 13 23:03:13 2015 -0700
@@ -416,7 +416,7 @@
 
     @repofilecache('bookmarks.current')
     def _bookmarkcurrent(self):
-        return bookmarks.readcurrent(self)
+        return bookmarks.readactive(self)
 
     def bookmarkheads(self, bookmark):
         name = bookmark.split('@', 1)[0]