Show More
@@ -1393,7 +1393,7 b' def obsmarkersversion(caps):' | |||||
1393 | def writenewbundle(ui, repo, source, filename, bundletype, outgoing, opts, |
|
1393 | def writenewbundle(ui, repo, source, filename, bundletype, outgoing, opts, | |
1394 | vfs=None, compression=None, compopts=None): |
|
1394 | vfs=None, compression=None, compopts=None): | |
1395 | if bundletype.startswith('HG10'): |
|
1395 | if bundletype.startswith('HG10'): | |
1396 |
cg = changegroup. |
|
1396 | cg = changegroup.makechangegroup(repo, outgoing, '01', source) | |
1397 | return writebundle(ui, cg, filename, bundletype, vfs=vfs, |
|
1397 | return writebundle(ui, cg, filename, bundletype, vfs=vfs, | |
1398 | compression=compression, compopts=compopts) |
|
1398 | compression=compression, compopts=compopts) | |
1399 | elif not bundletype.startswith('HG20'): |
|
1399 | elif not bundletype.startswith('HG20'): | |
@@ -1421,8 +1421,7 b' def _addpartsfromopts(ui, repo, bundler,' | |||||
1421 | cgversion = opts.get('cg.version') |
|
1421 | cgversion = opts.get('cg.version') | |
1422 | if cgversion is None: |
|
1422 | if cgversion is None: | |
1423 | cgversion = changegroup.safeversion(repo) |
|
1423 | cgversion = changegroup.safeversion(repo) | |
1424 |
cg = changegroup. |
|
1424 | cg = changegroup.makechangegroup(repo, outgoing, cgversion, source) | |
1425 | version=cgversion) |
|
|||
1426 | part = bundler.newpart('changegroup', data=cg.getchunks()) |
|
1425 | part = bundler.newpart('changegroup', data=cg.getchunks()) | |
1427 | part.addparam('version', cg.version) |
|
1426 | part.addparam('version', cg.version) | |
1428 | if 'clcount' in cg.extras: |
|
1427 | if 'clcount' in cg.extras: |
@@ -939,17 +939,6 b' def getsubsetraw(repo, outgoing, bundler' | |||||
939 | _changegroupinfo(repo, csets, source) |
|
939 | _changegroupinfo(repo, csets, source) | |
940 | return bundler.generate(commonrevs, csets, fastpathlinkrev, source) |
|
940 | return bundler.generate(commonrevs, csets, fastpathlinkrev, source) | |
941 |
|
941 | |||
942 | def getchangegroup(repo, source, outgoing, bundlecaps=None, |
|
|||
943 | version='01'): |
|
|||
944 | """Like getbundle, but taking a discovery.outgoing as an argument. |
|
|||
945 |
|
||||
946 | This is only implemented for local repos and reuses potentially |
|
|||
947 | precomputed sets in outgoing.""" |
|
|||
948 | if not outgoing.missing: |
|
|||
949 | return None |
|
|||
950 | return makechangegroup(repo, outgoing, version, source, |
|
|||
951 | bundlecaps=bundlecaps) |
|
|||
952 |
|
||||
953 | def _addchangegroupfiles(repo, source, revmap, trp, expectedfiles, needfiles): |
|
942 | def _addchangegroupfiles(repo, source, revmap, trp, expectedfiles, needfiles): | |
954 | revisions = 0 |
|
943 | revisions = 0 | |
955 | files = 0 |
|
944 | files = 0 |
@@ -965,8 +965,8 b' def _pushchangeset(pushop):' | |||||
965 | cg = changegroup.makechangegroup(pushop.repo, outgoing, '01', 'push', |
|
965 | cg = changegroup.makechangegroup(pushop.repo, outgoing, '01', 'push', | |
966 | fastpath=True, bundlecaps=bundlecaps) |
|
966 | fastpath=True, bundlecaps=bundlecaps) | |
967 | else: |
|
967 | else: | |
968 |
cg = changegroup. |
|
968 | cg = changegroup.makechangegroup(pushop.repo, outgoing, '01', | |
969 | bundlecaps=bundlecaps) |
|
969 | 'push', bundlecaps=bundlecaps) | |
970 |
|
970 | |||
971 | # apply changegroup to remote |
|
971 | # apply changegroup to remote | |
972 | # local repo finds heads on server, finds out what |
|
972 | # local repo finds heads on server, finds out what |
@@ -114,7 +114,8 b' Create an extension to test bundle2 API' | |||||
114 | > headmissing = [c.node() for c in repo.set('heads(%ld)', revs)] |
|
114 | > headmissing = [c.node() for c in repo.set('heads(%ld)', revs)] | |
115 | > headcommon = [c.node() for c in repo.set('parents(%ld) - %ld', revs, revs)] |
|
115 | > headcommon = [c.node() for c in repo.set('parents(%ld) - %ld', revs, revs)] | |
116 | > outgoing = discovery.outgoing(repo, headcommon, headmissing) |
|
116 | > outgoing = discovery.outgoing(repo, headcommon, headmissing) | |
117 |
> cg = changegroup. |
|
117 | > cg = changegroup.makechangegroup(repo, outgoing, '01', | |
|
118 | > 'test:bundle2') | |||
118 | > bundler.newpart('changegroup', data=cg.getchunks(), |
|
119 | > bundler.newpart('changegroup', data=cg.getchunks(), | |
119 | > mandatory=False) |
|
120 | > mandatory=False) | |
120 | > |
|
121 | > |
@@ -13,13 +13,13 b' Create an extension to test bundle2 with' | |||||
13 | > # in 'heads' as intermediate heads for the first changegroup. |
|
13 | > # in 'heads' as intermediate heads for the first changegroup. | |
14 | > intermediates = [repo[r].p1().node() for r in heads] |
|
14 | > intermediates = [repo[r].p1().node() for r in heads] | |
15 | > outgoing = discovery.outgoing(repo, common, intermediates) |
|
15 | > outgoing = discovery.outgoing(repo, common, intermediates) | |
16 |
> cg = changegroup. |
|
16 | > cg = changegroup.makechangegroup(repo, outgoing, '01', | |
17 | > bundlecaps=bundlecaps) |
|
17 | > source, bundlecaps=bundlecaps) | |
18 | > bundler.newpart('output', data='changegroup1') |
|
18 | > bundler.newpart('output', data='changegroup1') | |
19 | > bundler.newpart('changegroup', data=cg.getchunks()) |
|
19 | > bundler.newpart('changegroup', data=cg.getchunks()) | |
20 | > outgoing = discovery.outgoing(repo, common + intermediates, heads) |
|
20 | > outgoing = discovery.outgoing(repo, common + intermediates, heads) | |
21 |
> cg = changegroup. |
|
21 | > cg = changegroup.makechangegroup(repo, outgoing, '01', | |
22 | > bundlecaps=bundlecaps) |
|
22 | > source, bundlecaps=bundlecaps) | |
23 | > bundler.newpart('output', data='changegroup2') |
|
23 | > bundler.newpart('output', data='changegroup2') | |
24 | > bundler.newpart('changegroup', data=cg.getchunks()) |
|
24 | > bundler.newpart('changegroup', data=cg.getchunks()) | |
25 | > |
|
25 | > |
@@ -64,7 +64,8 b' Create an extension to test bundle2 remo' | |||||
64 | > common.extend(repo.lookup(r) for r in repo.revs(_common)) |
|
64 | > common.extend(repo.lookup(r) for r in repo.revs(_common)) | |
65 | > heads = [repo.lookup(r) for r in repo.revs(heads)] |
|
65 | > heads = [repo.lookup(r) for r in repo.revs(heads)] | |
66 | > outgoing = discovery.outgoing(repo, common, heads) |
|
66 | > outgoing = discovery.outgoing(repo, common, heads) | |
67 |
> cg = changegroup. |
|
67 | > cg = changegroup.makechangegroup(repo, outgoing, '01', | |
|
68 | > 'changegroup') | |||
68 | > newpart('changegroup', cg.getchunks()) |
|
69 | > newpart('changegroup', cg.getchunks()) | |
69 | > else: |
|
70 | > else: | |
70 | > raise Exception('unknown verb') |
|
71 | > raise Exception('unknown verb') |
General Comments 0
You need to be logged in to leave comments.
Login now