[PATCH 3 of 4 V2] bookmarks: rename readcurrent to readactive

Pierre-Yves David pierre-yves.david at ens-lyon.org
Wed May 6 01:54:18 CDT 2015



On 05/05/2015 09:30 PM, Martin von Zweigbergk wrote:
>
>
> On Tue, May 5, 2015 at 10:40 AM Ryan McElroy <rmcelroy at fb.com
> <mailto:rmcelroy at fb.com>> wrote:
>
>     # HG changeset patch
>     # User Ryan McElroy <rmcelroy at fb.com <mailto:rmcelroy at fb.com>>
>     # Date 1428991393 25200
>     #      Mon Apr 13 23:03:13 2015 -0700
>     # Node ID 3fae1a985ae9ef452aedb0e6c93ad02297248b4c
>     # Parent  736ffdcc73cb164b24ac97e58209f6f9995fd676
>     bookmarks: rename readcurrent to readactive
>
>     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.
>
>     diff --git a/hgext/rebase.py b/hgext/rebase.py
>     --- a/hgext/rebase.py
>     +++ b/hgext/rebase.py
>     @@ -888,7 +888,7 @@ def abort(repo, originalwd, target, stat
>                   repair.strip(repo.ui, repo, strippoints)
>
>           if activebookmark:
>     -        bookmarks.setcurrent(repo, activebookmark)
>     +        bookmarks.activate(repo, activebookmark)
>
>           clearstatus(repo)
>           repo.ui.warn(_('rebase aborted\n'))
>     diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py
>     --- a/mercurial/bookmarks.py
>     +++ b/mercurial/bookmarks.py
>     @@ -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)
>
>
> Wasn't this supposed to just be deleted or did I misunderstand Augie's
> comment?

In all case, we -do-not-want- to inflict such warning on users. If any 
such warning is to be issue, it should reused the 'devel-warn' logic 
that we use for the locking logic. This would narrow the warning to 
actual developer that can do something about it.

(I'm pointing this in general, not as something saying "we should keep 
compat here)

However, bookmark movement is probably pervasive enough that third party 
extension that we may want to keep some compatibility.

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list