Mercurial > public > mercurial-scm > hg
comparison mercurial/exchange.py @ 35267:cb4dcd7fabe7
getbundle: add support for 'bookmarks' boolean argument
This new argument requests a 'bookmarks' part from the server. It is meant to
be used instead of the "listkeys" request.
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Tue, 17 Oct 2017 15:27:17 +0200 |
parents | a1e70c1dbec0 |
children | 44b8b5ad30eb |
comparison
equal
deleted
inserted
replaced
35266:496154e41968 | 35267:cb4dcd7fabe7 |
---|---|
1753 part.addparam('nbchanges', '%d' % len(outgoing.missing), | 1753 part.addparam('nbchanges', '%d' % len(outgoing.missing), |
1754 mandatory=False) | 1754 mandatory=False) |
1755 if 'treemanifest' in repo.requirements: | 1755 if 'treemanifest' in repo.requirements: |
1756 part.addparam('treemanifest', '1') | 1756 part.addparam('treemanifest', '1') |
1757 | 1757 |
1758 @getbundle2partsgenerator('bookmarks') | |
1759 def _getbundlebookmarkpart(bundler, repo, source, bundlecaps=None, | |
1760 b2caps=None, **kwargs): | |
1761 """add a bookmark part to the requested bundle""" | |
1762 if not kwargs.get('bookmarks', False): | |
1763 return | |
1764 if 'bookmarks' not in b2caps: | |
1765 raise ValueError(_('no common bookmarks exchange method')) | |
1766 books = bookmod.listbinbookmarks(repo) | |
1767 data = bookmod.binaryencode(books) | |
1768 if data: | |
1769 bundler.newpart('bookmarks', data=data) | |
1770 | |
1758 @getbundle2partsgenerator('listkeys') | 1771 @getbundle2partsgenerator('listkeys') |
1759 def _getbundlelistkeysparts(bundler, repo, source, bundlecaps=None, | 1772 def _getbundlelistkeysparts(bundler, repo, source, bundlecaps=None, |
1760 b2caps=None, **kwargs): | 1773 b2caps=None, **kwargs): |
1761 """add parts containing listkeys namespaces to the requested bundle""" | 1774 """add parts containing listkeys namespaces to the requested bundle""" |
1762 listkeys = kwargs.get('listkeys', ()) | 1775 listkeys = kwargs.get('listkeys', ()) |