Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/localrepo.py @ 20954:dba91f8060eb
bundle2: add an exchange.getbundle function
This function can return a `HG10` or `HG20` bundle. It uses the `bundlecaps`
parameters to decides which one to return.
This is a distinct function from `changegroup.getbundle` for two reasons. First
the APIs of `bundle10` and `bundle20` are not compatible yet. The two functions
may be reunited in the future. Second `exchange.getbundle` will grow parameters
for all kinds of data (phases, obsmarkers, ...) so it's better to keep the
changegroup generation in its own function for now.
This function will be used it in the next changesets.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Fri, 04 Apr 2014 01:51:54 -0700 |
parents | 8d853cad6b14 |
children | 12f161f08d74 |
comparison
equal
deleted
inserted
replaced
20953:8d853cad6b14 | 20954:dba91f8060eb |
---|---|
103 def known(self, nodes): | 103 def known(self, nodes): |
104 return self._repo.known(nodes) | 104 return self._repo.known(nodes) |
105 | 105 |
106 def getbundle(self, source, heads=None, common=None, bundlecaps=None, | 106 def getbundle(self, source, heads=None, common=None, bundlecaps=None, |
107 format='HG10'): | 107 format='HG10'): |
108 return changegroup.getbundle(self._repo, source, heads=heads, | 108 return exchange.getbundle(self._repo, source, heads=heads, |
109 common=common, bundlecaps=bundlecaps) | 109 common=common, bundlecaps=bundlecaps) |
110 | 110 |
111 # TODO We might want to move the next two calls into legacypeer and add | 111 # TODO We might want to move the next two calls into legacypeer and add |
112 # unbundle instead. | 112 # unbundle instead. |
113 | 113 |
114 def lock(self): | 114 def lock(self): |