Patchwork [15,of,15,V2] exchange: drop unused '_getbookmarks' function

login
register
mail settings
Submitter Boris Feld
Date Nov. 2, 2017, 1:18 p.m.
Message ID <cfaaca09ba21da03f44a.1509628692@FB>
Download mbox | patch
Permalink /patch/25343/
State Accepted
Headers show

Comments

Boris Feld - Nov. 2, 2017, 1:18 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1508248540 -7200
#      Tue Oct 17 15:55:40 2017 +0200
# Node ID cfaaca09ba21da03f44a253348bc5de968928da3
# Parent  018fdb537668a81bd1f949ae6fe987a58b281ebf
# EXP-Topic b2.bookmarks
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r cfaaca09ba21
exchange: drop unused '_getbookmarks' function

The function was introduced in 8491845a75b2 in mid-November 2016 but is never
used anywhere in core. Binary support for bookmarks has now landed in core and
the getbundle API makes it easy to override it. So we just remove the dead
(unborn?) code.
Augie Fackler - Nov. 10, 2017, 10:46 p.m.
On Thu, Nov 02, 2017 at 02:18:12PM +0100, Boris Feld wrote:
> # HG changeset patch
> # User Boris Feld <boris.feld@octobus.net>
> # Date 1508248540 -7200
> #      Tue Oct 17 15:55:40 2017 +0200
> # Node ID cfaaca09ba21da03f44a253348bc5de968928da3
> # Parent  018fdb537668a81bd1f949ae6fe987a58b281ebf
> # EXP-Topic b2.bookmarks
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r cfaaca09ba21
> exchange: drop unused '_getbookmarks' function

This one is also queued with a tweak to the log message to not
reference things I didn't take yet. :)

I think the path for these should be a brief round of discussion on
the binary payload format (major bonus points if it can be used for
the forthcoming remotenames stuff pulkit has in mind), and then do a
v2 with the bits I didn't already take.

I can probably make myself available Monday morning to discuss wire
formats over VC if that'd be easier, but hopefully we can work out it
quickly enough via email.

>
> The function was introduced in 8491845a75b2 in mid-November 2016 but is never
> used anywhere in core. Binary support for bookmarks has now landed in core and
> the getbundle API makes it easy to override it. So we just remove the dead
> (unborn?) code.
>
> diff --git a/mercurial/exchange.py b/mercurial/exchange.py
> --- a/mercurial/exchange.py
> +++ b/mercurial/exchange.py
> @@ -1875,17 +1875,6 @@ def _getbundletagsfnodes(bundler, repo,
>      outgoing = _computeoutgoing(repo, heads, common)
>      bundle2.addparttagsfnodescache(repo, bundler, outgoing)
>
> -def _getbookmarks(repo, **kwargs):
> -    """Returns bookmark to node mapping.
> -
> -    This function is primarily used to generate `bookmarks` bundle2 part.
> -    It is a separate function in order to make it easy to wrap it
> -    in extensions. Passing `kwargs` to the function makes it easy to
> -    add new parameters in extensions.
> -    """
> -
> -    return dict(bookmod.listbinbookmarks(repo))
> -
>  def check_heads(repo, their_heads, context):
>      """check if the heads of a repo have been modified
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -1875,17 +1875,6 @@  def _getbundletagsfnodes(bundler, repo, 
     outgoing = _computeoutgoing(repo, heads, common)
     bundle2.addparttagsfnodescache(repo, bundler, outgoing)
 
-def _getbookmarks(repo, **kwargs):
-    """Returns bookmark to node mapping.
-
-    This function is primarily used to generate `bookmarks` bundle2 part.
-    It is a separate function in order to make it easy to wrap it
-    in extensions. Passing `kwargs` to the function makes it easy to
-    add new parameters in extensions.
-    """
-
-    return dict(bookmod.listbinbookmarks(repo))
-
 def check_heads(repo, their_heads, context):
     """check if the heads of a repo have been modified