Patchwork [1,of,4,V3] exchange: add `_get_bookmarks()` function

login
register
mail settings
Submitter Stanislau Hlebik
Date Aug. 25, 2016, 5:59 p.m.
Message ID <daecb4cb68a6abaf8059.1472147988@dev1918.lla1.facebook.com>
Download mbox | patch
Permalink /patch/16418/
State Accepted
Headers show

Comments

Stanislau Hlebik - Aug. 25, 2016, 5:59 p.m.
# HG changeset patch
# User Stanislau Hlebik <stash@fb.com>
# Date 1472147318 25200
#      Thu Aug 25 10:48:38 2016 -0700
# Node ID daecb4cb68a6abaf8059afee18d95481043ff2f6
# Parent  37b6f0ec6241a62de90737409458cd622e2fac0d
exchange: add `_get_bookmarks()` function

This function will be used to generate bookmarks bundle2 part.
It is a separate function in order to make it easy to overwrite it
in extensions. Passing `kwargs` to the function makes it easy to
add new parameters in extensions.

Patch

diff --git a/mercurial/exchange.py b/mercurial/exchange.py
--- a/mercurial/exchange.py
+++ b/mercurial/exchange.py
@@ -1650,6 +1650,9 @@ 
     if chunks:
         bundler.newpart('hgtagsfnodes', data=''.join(chunks))
 
+def _get_bookmarks(repo, kwargs):
+    return repo.listkeys(namespace='bookmarks')
+
 def check_heads(repo, their_heads, context):
     """check if the heads of a repo have been modified