Comments
Patch
@@ -107,12 +107,17 @@ class bmstore(dict):
fp.write("%s %s\n" % (hex(node), encoding.fromlocal(name)))
def readcurrent(repo):
- '''Get the current bookmark
+ warnings.warn('deprecated function bookmarks.readcurrent() called. ' +
+ 'update extension to call bookmarks.readactive() instead.',
+ category=DeprecationWarning, stacklevel=2)
+ return readactive(repo)
- 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')
@@ -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]