Mercurial > public > mercurial-scm > hg-stable
diff mercurial/bookmarks.py @ 24947:a02d293a1079
bookmarks: rename bookmarkcurrent to activebookmark (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 | Tue, 14 Apr 2015 13:17:33 -0700 |
parents | c44534209a0a |
children | eecd48369caa |
line wrap: on
line diff
--- a/mercurial/bookmarks.py Mon Apr 13 23:03:13 2015 -0700 +++ b/mercurial/bookmarks.py Tue Apr 14 13:17:33 2015 -0700 @@ -83,7 +83,7 @@ def _writerepo(self, repo): """Factored out for extensibility""" - if repo._bookmarkcurrent not in self: + if repo._activebookmark not in self: deactivate(repo) wlock = repo.wlock() @@ -137,7 +137,7 @@ if mark not in repo._bookmarks: raise AssertionError('bookmark %s does not exist!' % mark) - current = repo._bookmarkcurrent + current = repo._activebookmark if current == mark: return @@ -148,7 +148,7 @@ file.close() finally: wlock.release() - repo._bookmarkcurrent = mark + repo._activebookmark = mark def deactivate(repo): """ @@ -158,7 +158,7 @@ try: try: repo.vfs.unlink('bookmarks.current') - repo._bookmarkcurrent = None + repo._activebookmark = None except OSError, inst: if inst.errno != errno.ENOENT: raise @@ -172,7 +172,7 @@ parent of the working directory. ''' if not mark: - mark = repo._bookmarkcurrent + mark = repo._activebookmark if not parents: parents = [p.node() for p in repo[None].parents()] marks = repo._bookmarks @@ -209,7 +209,7 @@ check out and where to move the active bookmark from, if needed.''' movemarkfrom = None if checkout is None: - curmark = repo._bookmarkcurrent + curmark = repo._activebookmark if iscurrent(repo): movemarkfrom = repo['.'].node() elif curmark: @@ -221,7 +221,7 @@ deletefrom = parents marks = repo._bookmarks update = False - cur = repo._bookmarkcurrent + cur = repo._activebookmark if not cur: return False