##// END OF EJS Templates
bundle2: use headerless HG10UN stream in changegroup...
Pierre-Yves David -
r21062:e7c0a65a default
parent child Browse files
Show More
@@ -639,7 +639,7 b' def handlechangegroup(op, inpart):'
639 639 # we need to make sure we trigger the creation of a transaction object used
640 640 # for the whole processing scope.
641 641 op.gettransaction()
642 cg = changegroup.readbundle(inpart, 'bundle2part')
642 cg = changegroup.unbundle10(inpart, 'UN')
643 643 ret = changegroup.addchangegroup(op.repo, cg, 'bundle2', 'bundle2')
644 644 op.records.add('changegroup', {'return': ret})
645 645 if op.reply is not None:
@@ -109,6 +109,7 b' def push(repo, remote, force=False, revs'
109 109 if pushop.remote.capable('bundle2'):
110 110 _pushbundle2(pushop)
111 111 else:
112 _pushchangeset(pushop)
112 113 _pushcomputecommonheads(pushop)
113 114 _pushsyncphase(pushop)
114 115 _pushobsolete(pushop)
@@ -186,11 +187,7 b' def _pushbundle2(pushop):'
186 187 bundler.addpart(part)
187 188 # add the changegroup bundle
188 189 cg = changegroup.getlocalbundle(pushop.repo, 'push', pushop.outgoing)
189 def cgchunks(cg=cg):
190 yield 'HG10UN'
191 for c in cg.getchunks():
192 yield c
193 cgpart = bundle2.bundlepart('CHANGEGROUP', data=cgchunks())
190 cgpart = bundle2.bundlepart('CHANGEGROUP', data=cg.getchunks())
194 191 bundler.addpart(cgpart)
195 192 stream = util.chunkbuffer(bundler.getchunks())
196 193 sent = bundle2.unbundle20(pushop.repo.ui, stream)
@@ -634,11 +631,7 b' def getbundle(repo, source, heads=None, '
634 631 # very crude first implementation,
635 632 # the bundle API will change and the generation will be done lazily.
636 633 bundler = bundle2.bundle20(repo.ui)
637 def cgchunks(cg=cg):
638 yield 'HG10UN'
639 for c in cg.getchunks():
640 yield c
641 part = bundle2.bundlepart('changegroup', data=cgchunks())
634 part = bundle2.bundlepart('changegroup', data=cg.getchunks())
642 635 bundler.addpart(part)
643 636 return bundle2.unbundle20(repo.ui, util.chunkbuffer(bundler.getchunks()))
644 637
@@ -67,11 +67,7 b' Create an extension to test bundle2 API'
67 67 > headcommon = [c.node() for c in repo.set('parents(%ld) - %ld', revs, revs)]
68 68 > outgoing = discovery.outgoing(repo.changelog, headcommon, headmissing)
69 69 > cg = changegroup.getlocalbundle(repo, 'test:bundle2', outgoing, None)
70 > def cgchunks(cg=cg):
71 > yield 'HG10UN'
72 > for c in cg.getchunks():
73 > yield c
74 > part = bundle2.bundlepart('changegroup', data=cgchunks())
70 > part = bundle2.bundlepart('changegroup', data=cg.getchunks())
75 71 > bundler.addpart(part)
76 72 >
77 73 > if opts['parts']:
@@ -605,7 +601,7 b' Support for changegroup'
605 601 end of bundle
606 602
607 603 $ cat ../rev.hg2
608 HG20\x00\x00\x00\x12\x0bchangegroup\x00\x00\x00\x00\x00\x00\x00\x00\x06\x19HG10UN\x00\x00\x00\xa42\xafv\x86\xd4\x03\xcfE\xb5\xd9_-p\xce\xbe\xa5\x87\xac\x80j_\xdd\xd9\x89W\xc8\xa5JMCm\xfe\x1d\xa9\xd8\x7f!\xa1\xb9{\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x002\xafv\x86\xd4\x03\xcfE\xb5\xd9_-p\xce\xbe\xa5\x87\xac\x80j\x00\x00\x00\x00\x00\x00\x00)\x00\x00\x00)6e1f4c47ecb533ffd0c8e52cdc88afb6cd39e20c (esc)
604 HG20\x00\x00\x00\x12\x0bchangegroup\x00\x00\x00\x00\x00\x00\x00\x00\x06\x13\x00\x00\x00\xa42\xafv\x86\xd4\x03\xcfE\xb5\xd9_-p\xce\xbe\xa5\x87\xac\x80j_\xdd\xd9\x89W\xc8\xa5JMCm\xfe\x1d\xa9\xd8\x7f!\xa1\xb9{\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x002\xafv\x86\xd4\x03\xcfE\xb5\xd9_-p\xce\xbe\xa5\x87\xac\x80j\x00\x00\x00\x00\x00\x00\x00)\x00\x00\x00)6e1f4c47ecb533ffd0c8e52cdc88afb6cd39e20c (esc)
609 605 \x00\x00\x00f\x00\x00\x00h\x00\x00\x00\x02D (esc)
610 606 \x00\x00\x00i\x00\x00\x00j\x00\x00\x00\x01D\x00\x00\x00\xa4\x95 \xee\xa7\x81\xbc\xca\x16\xc1\xe1Z\xcc\x0b\xa1C5\xa0\xe8\xe5\xba\xcd\x01\x0b\x8c\xd9\x98\xf3\x98\x1aZ\x81\x15\xf9O\x8d\xa4\xabP`\x89\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x95 \xee\xa7\x81\xbc\xca\x16\xc1\xe1Z\xcc\x0b\xa1C5\xa0\xe8\xe5\xba\x00\x00\x00\x00\x00\x00\x00)\x00\x00\x00)4dece9c826f69490507b98c6383a3009b295837d (esc)
611 607 \x00\x00\x00f\x00\x00\x00h\x00\x00\x00\x02E (esc)
General Comments 0
You need to be logged in to leave comments. Login now