Mercurial > hg-stable
changeset 34161:75cc1f1e11f2
changegroup: add source parameter to generatemanifests
Extensions, like remotefilelog, will want to look at the source of a pull when
determining what manifests to add to a changegroup. For instance, on push they
will include everything, while on pull they won't.
Differential Revision: https://phab.mercurial-scm.org/D686
author | Durham Goode <durham@fb.com> |
---|---|
date | Mon, 11 Sep 2017 13:39:22 -0700 |
parents | c8b6ed51386b |
children | e9e0e1143fc5 |
files | mercurial/changegroup.py |
diffstat | 1 files changed, 7 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/changegroup.py Wed Sep 13 10:43:44 2017 -0700 +++ b/mercurial/changegroup.py Mon Sep 11 13:39:22 2017 -0700 @@ -662,7 +662,7 @@ 'treemanifest' not in repo.requirements) for chunk in self.generatemanifests(commonrevs, clrevorder, - fastpathlinkrev, mfs, fnodes): + fastpathlinkrev, mfs, fnodes, source): yield chunk mfs.clear() clrevs = set(cl.rev(x) for x in clnodes) @@ -688,7 +688,12 @@ repo.hook('outgoing', node=hex(clnodes[0]), source=source) def generatemanifests(self, commonrevs, clrevorder, fastpathlinkrev, mfs, - fnodes): + fnodes, source): + """Returns an iterator of changegroup chunks containing manifests. + + `source` is unused here, but is used by extensions like remotefilelog to + change what is sent based in pulls vs pushes, etc. + """ repo = self._repo mfl = repo.manifestlog dirlog = mfl._revlog.dirlog