Mercurial > hg
comparison mercurial/exchange.py @ 22353:47e3420ae889
getbundle: add `obsmarkers` argument to getbundle
This argument triggers the retrieval of all markers relevant to the set of
changesets defined by the nodes in `heads`.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Fri, 29 Aug 2014 12:36:17 +0200 |
parents | dc371d1f0de1 |
children | a89add6c6b2f |
comparison
equal
deleted
inserted
replaced
22352:dc371d1f0de1 | 22353:47e3420ae889 |
---|---|
997 for namespace in listkeys: | 997 for namespace in listkeys: |
998 part = bundler.newpart('b2x:listkeys') | 998 part = bundler.newpart('b2x:listkeys') |
999 part.addparam('namespace', namespace) | 999 part.addparam('namespace', namespace) |
1000 keys = repo.listkeys(namespace).items() | 1000 keys = repo.listkeys(namespace).items() |
1001 part.data = pushkey.encodekeys(keys) | 1001 part.data = pushkey.encodekeys(keys) |
1002 _getbundleobsmarkerpart(bundler, repo, source, heads=heads, common=common, | |
1003 bundlecaps=bundlecaps, **kwargs) | |
1002 _getbundleextrapart(bundler, repo, source, heads=heads, common=common, | 1004 _getbundleextrapart(bundler, repo, source, heads=heads, common=common, |
1003 bundlecaps=bundlecaps, **kwargs) | 1005 bundlecaps=bundlecaps, **kwargs) |
1004 return util.chunkbuffer(bundler.getchunks()) | 1006 return util.chunkbuffer(bundler.getchunks()) |
1007 | |
1008 def _getbundleobsmarkerpart(bundler, repo, source, heads=None, common=None, | |
1009 bundlecaps=None, **kwargs): | |
1010 if kwargs.get('obsmarkers', False): | |
1011 if heads is None: | |
1012 heads = repo.heads() | |
1013 subset = [c.node() for c in repo.set('::%ln', heads)] | |
1014 markers = repo.obsstore.relevantmarkers(subset) | |
1015 buildobsmarkerspart(bundler, markers) | |
1005 | 1016 |
1006 def _getbundleextrapart(bundler, repo, source, heads=None, common=None, | 1017 def _getbundleextrapart(bundler, repo, source, heads=None, common=None, |
1007 bundlecaps=None, **kwargs): | 1018 bundlecaps=None, **kwargs): |
1008 """hook function to let extensions add parts to the requested bundle""" | 1019 """hook function to let extensions add parts to the requested bundle""" |
1009 pass | 1020 pass |