commands: rename current to active in variables and comments
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.
--- a/mercurial/commands.py Thu May 28 20:03:42 2015 -0700
+++ b/mercurial/commands.py Thu May 28 20:06:19 2015 -0700
@@ -1041,8 +1041,8 @@
if len(marks) == 0 and not fm:
ui.status(_("no bookmarks set\n"))
for bmark, n in sorted(marks.iteritems()):
- current = repo._activebookmark
- if bmark == current:
+ active = repo._activebookmark
+ if bmark == active:
prefix, label = '*', activebookmarklabel
else:
prefix, label = ' ', ''
@@ -1054,7 +1054,7 @@
pad = " " * (25 - encoding.colwidth(bmark))
fm.condwrite(not ui.quiet, 'rev node', pad + ' %d:%s',
repo.changelog.rev(n), hexfn(n), label=label)
- fm.data(active=(bmark == current))
+ fm.data(active=(bmark == active))
fm.plain('\n')
fm.end()
@@ -1523,7 +1523,7 @@
match,
extra=extra)
- current = repo._activebookmark
+ active = repo._activebookmark
marks = old.bookmarks()
node = cmdutil.amend(ui, repo, commitfunc, old, extra, pats, opts)
if node == old.node():
@@ -1535,7 +1535,7 @@
newmarks = repo._bookmarks
for bm in marks:
newmarks[bm] = node
- if bm == current:
+ if bm == active:
bookmarks.activate(repo, bm)
newmarks.write()
else:
@@ -5933,15 +5933,15 @@
ui.status(m, label='log.branch')
if marks:
- current = repo._activebookmark
+ active = repo._activebookmark
# i18n: column positioning for "hg summary"
ui.write(_('bookmarks:'), label='log.bookmark')
- if current is not None:
- if current in marks:
- ui.write(' *' + current, label=activebookmarklabel)
- marks.remove(current)
+ if active is not None:
+ if active in marks:
+ ui.write(' *' + active, label=activebookmarklabel)
+ marks.remove(active)
else:
- ui.write(' [%s]' % current, label=activebookmarklabel)
+ ui.write(' [%s]' % active, label=activebookmarklabel)
for m in marks:
ui.write(' ' + m, label='log.bookmark')
ui.write('\n', label='log.bookmark')
@@ -6361,7 +6361,7 @@
Update the repository's working directory to the specified
changeset. If no changeset is specified, update to the tip of the
- current named branch and move the current bookmark (see :hg:`help
+ current named branch and move the active bookmark (see :hg:`help
bookmarks`).
Update sets the working directory's parent revision to the specified
@@ -6414,7 +6414,7 @@
cmdutil.clearunfinished(repo)
- # with no argument, we also move the current bookmark, if any
+ # with no argument, we also move the active bookmark, if any
rev, movemarkfrom = bookmarks.calculateupdate(ui, repo, rev)
# if we defined a bookmark, we have to remember the original bookmark name
--- a/tests/test-bookmarks-current.t Thu May 28 20:03:42 2015 -0700
+++ b/tests/test-bookmarks-current.t Thu May 28 20:06:19 2015 -0700
@@ -69,7 +69,7 @@
* Y 0:719295282060
Z -1:000000000000
-Verify that switching to Z updates the current bookmark:
+Verify that switching to Z updates the active bookmark:
$ hg update Z
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
(activating bookmark Z)
@@ -118,7 +118,7 @@
* Y 0:719295282060
Z 0:719295282060
-deactivate current bookmark using -i
+deactivate active bookmark using -i
$ hg bookmark -i Y
$ hg bookmarks
@@ -137,7 +137,7 @@
* Y 0:719295282060
Z 0:719295282060
-deactivate current bookmark while renaming
+deactivate active bookmark while renaming
$ hg bookmark -i -m Y X
$ hg bookmarks
--- a/tests/test-bookmarks.t Thu May 28 20:03:42 2015 -0700
+++ b/tests/test-bookmarks.t Thu May 28 20:06:19 2015 -0700
@@ -530,7 +530,7 @@
added 2 changesets with 2 changes to 2 files (+1 heads)
(run 'hg heads' to see heads, 'hg merge' to merge)
-update to current bookmark if it's not the parent
+update to active bookmark if it's not the parent
$ hg summary
parent: 2:db815d6d32e6
--- a/tests/test-command-template.t Thu May 28 20:03:42 2015 -0700
+++ b/tests/test-command-template.t Thu May 28 20:06:19 2015 -0700
@@ -3082,7 +3082,7 @@
Rev: 0
Ancestor: 0
-Test current bookmark templating
+Test active bookmark templating
$ hg book foo
$ hg book bar