Comments
Patch
@@ -1675,6 +1675,21 @@
if chunks:
bundler.newpart('hgtagsfnodes', data=''.join(chunks))
+@getbundle2partsgenerator('bookmarks')
+def _getbundlebookmarkspart(bundler, repo, source, bundlecaps=None,
+ b2caps=None, heads=None, common=None,
+ **kwargs):
+ if not kwargs.get('bookmarks'):
+ return
+ if 'bookmarks' not in b2caps:
+ raise ValueError(
+ _('bookmarks are requested but client is not capable '
+ 'of receiving it'))
+
+ bookmarks = _getbookmarks(repo, **kwargs)
+ encodedbookmarks = bookmod.encodebookmarks(bookmarks)
+ bundler.newpart('bookmarks', data=encodedbookmarks)
+
def _getbookmarks(repo, **kwargs):
"""Returns bookmark to node mapping.
@@ -212,7 +212,9 @@
'bundlecaps': 'scsv',
'listkeys': 'csv',
'cg': 'boolean',
- 'cbattempted': 'boolean'}
+ 'cbattempted': 'boolean',
+ 'bookmarks': 'boolean',
+ }
# client side