Mercurial > public > mercurial-scm > hg
comparison mercurial/changegroup.py @ 26509:83d82fbefccb
changegroup: add version argument to getchangegroup
For some obscure reasons (probably upsetting a Greek goddess),
getchangegroup did not had a 'version' argument to control the changegroup
version. We fixes this to allow cg02 to be used with 'hg bundle' in the future.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Thu, 01 Oct 2015 19:14:47 -0700 |
parents | 47a12de9ac3f |
children | 7469067de2ba |
comparison
equal
deleted
inserted
replaced
26508:47a12de9ac3f | 26509:83d82fbefccb |
---|---|
643 common = [nullid] | 643 common = [nullid] |
644 if not heads: | 644 if not heads: |
645 heads = cl.heads() | 645 heads = cl.heads() |
646 return discovery.outgoing(cl, common, heads) | 646 return discovery.outgoing(cl, common, heads) |
647 | 647 |
648 def getchangegroup(repo, source, heads=None, common=None, bundlecaps=None): | 648 def getchangegroup(repo, source, heads=None, common=None, bundlecaps=None, |
649 version='01'): | |
649 """Like changegroupsubset, but returns the set difference between the | 650 """Like changegroupsubset, but returns the set difference between the |
650 ancestors of heads and the ancestors common. | 651 ancestors of heads and the ancestors common. |
651 | 652 |
652 If heads is None, use the local heads. If common is None, use [nullid]. | 653 If heads is None, use the local heads. If common is None, use [nullid]. |
653 | 654 |
654 The nodes in common might not all be known locally due to the way the | 655 The nodes in common might not all be known locally due to the way the |
655 current discovery protocol works. | 656 current discovery protocol works. |
656 """ | 657 """ |
657 outgoing = computeoutgoing(repo, heads, common) | 658 outgoing = computeoutgoing(repo, heads, common) |
658 return getlocalchangegroup(repo, source, outgoing, bundlecaps=bundlecaps) | 659 return getlocalchangegroup(repo, source, outgoing, bundlecaps=bundlecaps, |
660 version=version) | |
659 | 661 |
660 def changegroup(repo, basenodes, source): | 662 def changegroup(repo, basenodes, source): |
661 # to avoid a race we use changegroupsubset() (issue1320) | 663 # to avoid a race we use changegroupsubset() (issue1320) |
662 return changegroupsubset(repo, basenodes, repo.heads(), source) | 664 return changegroupsubset(repo, basenodes, repo.heads(), source) |
663 | 665 |