##// 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 # we need to make sure we trigger the creation of a transaction object used
639 # we need to make sure we trigger the creation of a transaction object used
640 # for the whole processing scope.
640 # for the whole processing scope.
641 op.gettransaction()
641 op.gettransaction()
642 cg = changegroup.readbundle(inpart, 'bundle2part')
642 cg = changegroup.unbundle10(inpart, 'UN')
643 ret = changegroup.addchangegroup(op.repo, cg, 'bundle2', 'bundle2')
643 ret = changegroup.addchangegroup(op.repo, cg, 'bundle2', 'bundle2')
644 op.records.add('changegroup', {'return': ret})
644 op.records.add('changegroup', {'return': ret})
645 if op.reply is not None:
645 if op.reply is not None:
@@ -109,6 +109,7 b' def push(repo, remote, force=False, revs'
109 if pushop.remote.capable('bundle2'):
109 if pushop.remote.capable('bundle2'):
110 _pushbundle2(pushop)
110 _pushbundle2(pushop)
111 else:
111 else:
112 _pushchangeset(pushop)
112 _pushcomputecommonheads(pushop)
113 _pushcomputecommonheads(pushop)
113 _pushsyncphase(pushop)
114 _pushsyncphase(pushop)
114 _pushobsolete(pushop)
115 _pushobsolete(pushop)
@@ -186,11 +187,7 b' def _pushbundle2(pushop):'
186 bundler.addpart(part)
187 bundler.addpart(part)
187 # add the changegroup bundle
188 # add the changegroup bundle
188 cg = changegroup.getlocalbundle(pushop.repo, 'push', pushop.outgoing)
189 cg = changegroup.getlocalbundle(pushop.repo, 'push', pushop.outgoing)
189 def cgchunks(cg=cg):
190 cgpart = bundle2.bundlepart('CHANGEGROUP', data=cg.getchunks())
190 yield 'HG10UN'
191 for c in cg.getchunks():
192 yield c
193 cgpart = bundle2.bundlepart('CHANGEGROUP', data=cgchunks())
194 bundler.addpart(cgpart)
191 bundler.addpart(cgpart)
195 stream = util.chunkbuffer(bundler.getchunks())
192 stream = util.chunkbuffer(bundler.getchunks())
196 sent = bundle2.unbundle20(pushop.repo.ui, stream)
193 sent = bundle2.unbundle20(pushop.repo.ui, stream)
@@ -634,11 +631,7 b' def getbundle(repo, source, heads=None, '
634 # very crude first implementation,
631 # very crude first implementation,
635 # the bundle API will change and the generation will be done lazily.
632 # the bundle API will change and the generation will be done lazily.
636 bundler = bundle2.bundle20(repo.ui)
633 bundler = bundle2.bundle20(repo.ui)
637 def cgchunks(cg=cg):
634 part = bundle2.bundlepart('changegroup', data=cg.getchunks())
638 yield 'HG10UN'
639 for c in cg.getchunks():
640 yield c
641 part = bundle2.bundlepart('changegroup', data=cgchunks())
642 bundler.addpart(part)
635 bundler.addpart(part)
643 return bundle2.unbundle20(repo.ui, util.chunkbuffer(bundler.getchunks()))
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 > headcommon = [c.node() for c in repo.set('parents(%ld) - %ld', revs, revs)]
67 > headcommon = [c.node() for c in repo.set('parents(%ld) - %ld', revs, revs)]
68 > outgoing = discovery.outgoing(repo.changelog, headcommon, headmissing)
68 > outgoing = discovery.outgoing(repo.changelog, headcommon, headmissing)
69 > cg = changegroup.getlocalbundle(repo, 'test:bundle2', outgoing, None)
69 > cg = changegroup.getlocalbundle(repo, 'test:bundle2', outgoing, None)
70 > def cgchunks(cg=cg):
70 > part = bundle2.bundlepart('changegroup', data=cg.getchunks())
71 > yield 'HG10UN'
72 > for c in cg.getchunks():
73 > yield c
74 > part = bundle2.bundlepart('changegroup', data=cgchunks())
75 > bundler.addpart(part)
71 > bundler.addpart(part)
76 >
72 >
77 > if opts['parts']:
73 > if opts['parts']:
@@ -605,7 +601,7 b' Support for changegroup'
605 end of bundle
601 end of bundle
606
602
607 $ cat ../rev.hg2
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 \x00\x00\x00f\x00\x00\x00h\x00\x00\x00\x02D (esc)
605 \x00\x00\x00f\x00\x00\x00h\x00\x00\x00\x02D (esc)
610 \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)
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 \x00\x00\x00f\x00\x00\x00h\x00\x00\x00\x02E (esc)
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