Show More
@@ -987,7 +987,7 b' def computeoutgoing(repo, heads, common)' | |||
|
987 | 987 | heads = cl.heads() |
|
988 | 988 | return discovery.outgoing(repo, common, heads) |
|
989 | 989 | |
|
990 |
def getchangegroup(repo, source, |
|
|
990 | def getchangegroup(repo, source, outgoing, bundlecaps=None, | |
|
991 | 991 | version='01'): |
|
992 | 992 | """Like changegroupsubset, but returns the set difference between the |
|
993 | 993 | ancestors of heads and the ancestors common. |
@@ -997,7 +997,6 b' def getchangegroup(repo, source, heads=N' | |||
|
997 | 997 | The nodes in common might not all be known locally due to the way the |
|
998 | 998 | current discovery protocol works. |
|
999 | 999 | """ |
|
1000 | outgoing = computeoutgoing(repo, heads, common) | |
|
1001 | 1000 | return getlocalchangegroup(repo, source, outgoing, bundlecaps=bundlecaps, |
|
1002 | 1001 | version=version) |
|
1003 | 1002 |
@@ -1412,9 +1412,10 b' def bundle(ui, repo, fname, dest=None, *' | |||
|
1412 | 1412 | "a destination")) |
|
1413 | 1413 | common = [repo.lookup(rev) for rev in base] |
|
1414 | 1414 | heads = revs and map(repo.lookup, revs) or revs |
|
1415 | cg = changegroup.getchangegroup(repo, 'bundle', heads=heads, | |
|
1416 | common=common, bundlecaps=bundlecaps, | |
|
1417 |
|
|
|
1415 | outgoing = discovery.outgoing(repo, common, heads) | |
|
1416 | cg = changegroup.getchangegroup(repo, 'bundle', outgoing, | |
|
1417 | bundlecaps=bundlecaps, | |
|
1418 | version=cgversion) | |
|
1418 | 1419 | outgoing = None |
|
1419 | 1420 | else: |
|
1420 | 1421 | dest = ui.expandpath(dest or 'default-push', dest or 'default') |
@@ -1536,8 +1536,9 b' def getbundle(repo, source, heads=None, ' | |||
|
1536 | 1536 | if kwargs: |
|
1537 | 1537 | raise ValueError(_('unsupported getbundle arguments: %s') |
|
1538 | 1538 | % ', '.join(sorted(kwargs.keys()))) |
|
1539 | return changegroup.getchangegroup(repo, source, heads=heads, | |
|
1540 | common=common, bundlecaps=bundlecaps) | |
|
1539 | outgoing = changegroup.computeoutgoing(repo, heads, common) | |
|
1540 | return changegroup.getchangegroup(repo, source, outgoing, | |
|
1541 | bundlecaps=bundlecaps) | |
|
1541 | 1542 | |
|
1542 | 1543 | # bundle20 case |
|
1543 | 1544 | b2caps = {} |
@@ -3,7 +3,7 b' Create an extension to test bundle2 with' | |||
|
3 | 3 | $ cat > bundle2.py <<EOF |
|
4 | 4 | > """ |
|
5 | 5 | > """ |
|
6 | > from mercurial import changegroup, exchange | |
|
6 | > from mercurial import changegroup, discovery, exchange | |
|
7 | 7 | > |
|
8 | 8 | > def _getbundlechangegrouppart(bundler, repo, source, bundlecaps=None, |
|
9 | 9 | > b2caps=None, heads=None, common=None, |
@@ -12,13 +12,14 b' Create an extension to test bundle2 with' | |||
|
12 | 12 | > # changegroup part we are being requested. Use the parent of each head |
|
13 | 13 | > # in 'heads' as intermediate heads for the first changegroup. |
|
14 | 14 | > intermediates = [repo[r].p1().node() for r in heads] |
|
15 | > cg = changegroup.getchangegroup(repo, source, heads=intermediates, | |
|
16 | > common=common, bundlecaps=bundlecaps) | |
|
15 | > outgoing = discovery.outgoing(repo, common, intermediates) | |
|
16 | > cg = changegroup.getchangegroup(repo, source, outgoing, | |
|
17 | > bundlecaps=bundlecaps) | |
|
17 | 18 | > bundler.newpart('output', data='changegroup1') |
|
18 | 19 | > bundler.newpart('changegroup', data=cg.getchunks()) |
|
19 | > cg = changegroup.getchangegroup(repo, source, heads=heads, | |
|
20 | > common=common + intermediates, | |
|
21 |
> |
|
|
20 | > outgoing = discovery.outgoing(repo, common + intermediates, heads) | |
|
21 | > cg = changegroup.getchangegroup(repo, source, outgoing, | |
|
22 | > bundlecaps=bundlecaps) | |
|
22 | 23 | > bundler.newpart('output', data='changegroup2') |
|
23 | 24 | > bundler.newpart('changegroup', data=cg.getchunks()) |
|
24 | 25 | > |
@@ -8,7 +8,7 b' Create an extension to test bundle2 remo' | |||
|
8 | 8 | > Current bundle2 implementation doesn't provide a way to generate those |
|
9 | 9 | > parts, so they must be created by extensions. |
|
10 | 10 | > """ |
|
11 | > from mercurial import bundle2, changegroup, exchange, util | |
|
11 | > from mercurial import bundle2, changegroup, discovery, exchange, util | |
|
12 | 12 | > |
|
13 | 13 | > def _getbundlechangegrouppart(bundler, repo, source, bundlecaps=None, |
|
14 | 14 | > b2caps=None, heads=None, common=None, |
@@ -22,7 +22,7 b' Create an extension to test bundle2 remo' | |||
|
22 | 22 | > part to add: |
|
23 | 23 | > - changegroup common_revset heads_revset |
|
24 | 24 | > Creates a changegroup part based, using common_revset and |
|
25 |
> heads_revset for |
|
|
25 | > heads_revset for outgoing | |
|
26 | 26 | > - remote-changegroup url file |
|
27 | 27 | > Creates a remote-changegroup part for a bundle at the given |
|
28 | 28 | > url. Size and digest, as required by the client, are computed |
@@ -63,8 +63,8 b' Create an extension to test bundle2 remo' | |||
|
63 | 63 | > _common, heads = args.split() |
|
64 | 64 | > common.extend(repo.lookup(r) for r in repo.revs(_common)) |
|
65 | 65 | > heads = [repo.lookup(r) for r in repo.revs(heads)] |
|
66 | > cg = changegroup.getchangegroup(repo, 'changegroup', | |
|
67 | > heads=heads, common=common) | |
|
66 | > outgoing = discovery.outgoing(repo, common, heads) | |
|
67 | > cg = changegroup.getchangegroup(repo, 'changegroup', outgoing) | |
|
68 | 68 | > newpart('changegroup', cg.getchunks()) |
|
69 | 69 | > else: |
|
70 | 70 | > raise Exception('unknown verb') |
General Comments 0
You need to be logged in to leave comments.
Login now