[PATCH 2 of 3] bookmarks: remove unused updatecurrentbookmark function (API)

Martin von Zweigbergk martinvonz at google.com
Thu May 7 17:04:06 CDT 2015


On Thu, May 7, 2015 at 2:00 PM Ryan McElroy <rmcelroy at fb.com> wrote:

> # HG changeset patch
> # User Ryan McElroy <rmcelroy at fb.com>
> # Date 1429043510 25200
> #      Tue Apr 14 13:31:50 2015 -0700
> # Node ID 258d4654240ae6e6978acaeab753ed65c6843789
> # Parent  ccb7b2b9a2f0dc5ac57e2e13e48180a03ad6d175
> bookmarks: remove unused updatecurrentbookmark function (API)
>
> This function was not used anywhere in core and there is no indication that
> it is used elsewhere either.
>

I've pushed this to the clowncopter, thanks.

The last caller seems to have been removed in f72b71ba756b (unbundle: don't
advance bookmarks (issue4322) (BC), 2014-08-10).


>
> diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py
> --- a/mercurial/bookmarks.py
> +++ b/mercurial/bookmarks.py
> @@ -8,7 +8,7 @@
>  import os
>  from mercurial.i18n import _
>  from mercurial.node import hex, bin
> -from mercurial import encoding, error, util, obsolete, lock as lockmod
> +from mercurial import encoding, util, obsolete, lock as lockmod
>  import errno
>
>  class bmstore(dict):
> @@ -175,15 +175,6 @@ def isactivecurrent(repo):
>      parents = [p.node() for p in repo[None].parents()]
>      return (mark in marks and marks[mark] in parents)
>
> -def updatecurrentbookmark(repo, oldnode, curbranch):
> -    try:
> -        return update(repo, oldnode, repo.branchtip(curbranch))
> -    except error.RepoLookupError:
> -        if curbranch == "default": # no default branch!
> -            return update(repo, oldnode, repo.lookup("tip"))
> -        else:
> -            raise util.Abort(_("branch %s not found") % curbranch)
> -
>  def deletedivergent(repo, deletefrom, bm):
>      '''Delete divergent versions of bm on nodes in deletefrom.
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20150507/bb853c40/attachment.html>


More information about the Mercurial-devel mailing list