##// END OF EJS Templates
bundle2: rename format, parts and config to final names...
Pierre-Yves David -
r24686:e0e28e91 default
parent child Browse files
Show More
@@ -358,7 +358,7 b' def _processpart(op, part):'
358 if output is not None:
358 if output is not None:
359 output = op.ui.popbuffer()
359 output = op.ui.popbuffer()
360 if output:
360 if output:
361 outpart = op.reply.newpart('b2x:output', data=output,
361 outpart = op.reply.newpart('output', data=output,
362 mandatory=False)
362 mandatory=False)
363 outpart.addparam('in-reply-to', str(part.id), mandatory=False)
363 outpart.addparam('in-reply-to', str(part.id), mandatory=False)
364 finally:
364 finally:
@@ -408,7 +408,7 b' class bundle20(object):'
408 populate it. Then call `getchunks` to retrieve all the binary chunks of
408 populate it. Then call `getchunks` to retrieve all the binary chunks of
409 data that compose the bundle2 container."""
409 data that compose the bundle2 container."""
410
410
411 _magicstring = 'HG2Y'
411 _magicstring = 'HG20'
412
412
413 def __init__(self, ui, capabilities=()):
413 def __init__(self, ui, capabilities=()):
414 self.ui = ui
414 self.ui = ui
@@ -616,7 +616,7 b' class unbundle20(unpackermixin):'
616 def compressed(self):
616 def compressed(self):
617 return False
617 return False
618
618
619 formatmap = {'2Y': unbundle20}
619 formatmap = {'20': unbundle20}
620
620
621 class bundlepart(object):
621 class bundlepart(object):
622 """A bundle2 part contains application level payload
622 """A bundle2 part contains application level payload
@@ -734,7 +734,7 b' class bundlepart(object):'
734 # backup exception data for later
734 # backup exception data for later
735 exc_info = sys.exc_info()
735 exc_info = sys.exc_info()
736 msg = 'unexpected error: %s' % exc
736 msg = 'unexpected error: %s' % exc
737 interpart = bundlepart('b2x:error:abort', [('message', msg)],
737 interpart = bundlepart('error:abort', [('message', msg)],
738 mandatory=False)
738 mandatory=False)
739 interpart.id = 0
739 interpart.id = 0
740 yield _pack(_fpayloadsize, -1)
740 yield _pack(_fpayloadsize, -1)
@@ -982,11 +982,11 b' class unbundlepart(unpackermixin):'
982 raise util.Abort(_('Seek failed\n'))
982 raise util.Abort(_('Seek failed\n'))
983 self._pos = newpos
983 self._pos = newpos
984
984
985 capabilities = {'HG2Y': (),
985 capabilities = {'HG20': (),
986 'b2x:listkeys': (),
986 'listkeys': (),
987 'b2x:pushkey': (),
987 'pushkey': (),
988 'digests': tuple(sorted(util.DIGESTS.keys())),
988 'digests': tuple(sorted(util.DIGESTS.keys())),
989 'b2x:remote-changegroup': ('http', 'https'),
989 'remote-changegroup': ('http', 'https'),
990 }
990 }
991
991
992 def getrepocaps(repo, allowpushback=False):
992 def getrepocaps(repo, allowpushback=False):
@@ -995,29 +995,29 b' def getrepocaps(repo, allowpushback=Fals'
995 Exists to allow extensions (like evolution) to mutate the capabilities.
995 Exists to allow extensions (like evolution) to mutate the capabilities.
996 """
996 """
997 caps = capabilities.copy()
997 caps = capabilities.copy()
998 caps['b2x:changegroup'] = tuple(sorted(changegroup.packermap.keys()))
998 caps['changegroup'] = tuple(sorted(changegroup.packermap.keys()))
999 if obsolete.isenabled(repo, obsolete.exchangeopt):
999 if obsolete.isenabled(repo, obsolete.exchangeopt):
1000 supportedformat = tuple('V%i' % v for v in obsolete.formats)
1000 supportedformat = tuple('V%i' % v for v in obsolete.formats)
1001 caps['b2x:obsmarkers'] = supportedformat
1001 caps['obsmarkers'] = supportedformat
1002 if allowpushback:
1002 if allowpushback:
1003 caps['b2x:pushback'] = ()
1003 caps['pushback'] = ()
1004 return caps
1004 return caps
1005
1005
1006 def bundle2caps(remote):
1006 def bundle2caps(remote):
1007 """return the bundle capabilities of a peer as dict"""
1007 """return the bundle capabilities of a peer as dict"""
1008 raw = remote.capable('bundle2-exp')
1008 raw = remote.capable('bundle2')
1009 if not raw and raw != '':
1009 if not raw and raw != '':
1010 return {}
1010 return {}
1011 capsblob = urllib.unquote(remote.capable('bundle2-exp'))
1011 capsblob = urllib.unquote(remote.capable('bundle2'))
1012 return decodecaps(capsblob)
1012 return decodecaps(capsblob)
1013
1013
1014 def obsmarkersversion(caps):
1014 def obsmarkersversion(caps):
1015 """extract the list of supported obsmarkers versions from a bundle2caps dict
1015 """extract the list of supported obsmarkers versions from a bundle2caps dict
1016 """
1016 """
1017 obscaps = caps.get('b2x:obsmarkers', ())
1017 obscaps = caps.get('obsmarkers', ())
1018 return [int(c[1:]) for c in obscaps if c.startswith('V')]
1018 return [int(c[1:]) for c in obscaps if c.startswith('V')]
1019
1019
1020 @parthandler('b2x:changegroup', ('version',))
1020 @parthandler('changegroup', ('version',))
1021 def handlechangegroup(op, inpart):
1021 def handlechangegroup(op, inpart):
1022 """apply a changegroup part on the repo
1022 """apply a changegroup part on the repo
1023
1023
@@ -1041,14 +1041,14 b' def handlechangegroup(op, inpart):'
1041 if op.reply is not None:
1041 if op.reply is not None:
1042 # This is definitely not the final form of this
1042 # This is definitely not the final form of this
1043 # return. But one need to start somewhere.
1043 # return. But one need to start somewhere.
1044 part = op.reply.newpart('b2x:reply:changegroup', mandatory=False)
1044 part = op.reply.newpart('reply:changegroup', mandatory=False)
1045 part.addparam('in-reply-to', str(inpart.id), mandatory=False)
1045 part.addparam('in-reply-to', str(inpart.id), mandatory=False)
1046 part.addparam('return', '%i' % ret, mandatory=False)
1046 part.addparam('return', '%i' % ret, mandatory=False)
1047 assert not inpart.read()
1047 assert not inpart.read()
1048
1048
1049 _remotechangegroupparams = tuple(['url', 'size', 'digests'] +
1049 _remotechangegroupparams = tuple(['url', 'size', 'digests'] +
1050 ['digest:%s' % k for k in util.DIGESTS.keys()])
1050 ['digest:%s' % k for k in util.DIGESTS.keys()])
1051 @parthandler('b2x:remote-changegroup', _remotechangegroupparams)
1051 @parthandler('remote-changegroup', _remotechangegroupparams)
1052 def handleremotechangegroup(op, inpart):
1052 def handleremotechangegroup(op, inpart):
1053 """apply a bundle10 on the repo, given an url and validation information
1053 """apply a bundle10 on the repo, given an url and validation information
1054
1054
@@ -1070,7 +1070,7 b' def handleremotechangegroup(op, inpart):'
1070 except KeyError:
1070 except KeyError:
1071 raise util.Abort(_('remote-changegroup: missing "%s" param') % 'url')
1071 raise util.Abort(_('remote-changegroup: missing "%s" param') % 'url')
1072 parsed_url = util.url(raw_url)
1072 parsed_url = util.url(raw_url)
1073 if parsed_url.scheme not in capabilities['b2x:remote-changegroup']:
1073 if parsed_url.scheme not in capabilities['remote-changegroup']:
1074 raise util.Abort(_('remote-changegroup does not support %s urls') %
1074 raise util.Abort(_('remote-changegroup does not support %s urls') %
1075 parsed_url.scheme)
1075 parsed_url.scheme)
1076
1076
@@ -1110,7 +1110,7 b' def handleremotechangegroup(op, inpart):'
1110 if op.reply is not None:
1110 if op.reply is not None:
1111 # This is definitely not the final form of this
1111 # This is definitely not the final form of this
1112 # return. But one need to start somewhere.
1112 # return. But one need to start somewhere.
1113 part = op.reply.newpart('b2x:reply:changegroup')
1113 part = op.reply.newpart('reply:changegroup')
1114 part.addparam('in-reply-to', str(inpart.id), mandatory=False)
1114 part.addparam('in-reply-to', str(inpart.id), mandatory=False)
1115 part.addparam('return', '%i' % ret, mandatory=False)
1115 part.addparam('return', '%i' % ret, mandatory=False)
1116 try:
1116 try:
@@ -1120,13 +1120,13 b' def handleremotechangegroup(op, inpart):'
1120 (util.hidepassword(raw_url), str(e)))
1120 (util.hidepassword(raw_url), str(e)))
1121 assert not inpart.read()
1121 assert not inpart.read()
1122
1122
1123 @parthandler('b2x:reply:changegroup', ('return', 'in-reply-to'))
1123 @parthandler('reply:changegroup', ('return', 'in-reply-to'))
1124 def handlereplychangegroup(op, inpart):
1124 def handlereplychangegroup(op, inpart):
1125 ret = int(inpart.params['return'])
1125 ret = int(inpart.params['return'])
1126 replyto = int(inpart.params['in-reply-to'])
1126 replyto = int(inpart.params['in-reply-to'])
1127 op.records.add('changegroup', {'return': ret}, replyto)
1127 op.records.add('changegroup', {'return': ret}, replyto)
1128
1128
1129 @parthandler('b2x:check:heads')
1129 @parthandler('check:heads')
1130 def handlecheckheads(op, inpart):
1130 def handlecheckheads(op, inpart):
1131 """check that head of the repo did not change
1131 """check that head of the repo did not change
1132
1132
@@ -1142,13 +1142,13 b' def handlecheckheads(op, inpart):'
1142 raise error.PushRaced('repository changed while pushing - '
1142 raise error.PushRaced('repository changed while pushing - '
1143 'please try again')
1143 'please try again')
1144
1144
1145 @parthandler('b2x:output')
1145 @parthandler('output')
1146 def handleoutput(op, inpart):
1146 def handleoutput(op, inpart):
1147 """forward output captured on the server to the client"""
1147 """forward output captured on the server to the client"""
1148 for line in inpart.read().splitlines():
1148 for line in inpart.read().splitlines():
1149 op.ui.write(('remote: %s\n' % line))
1149 op.ui.write(('remote: %s\n' % line))
1150
1150
1151 @parthandler('b2x:replycaps')
1151 @parthandler('replycaps')
1152 def handlereplycaps(op, inpart):
1152 def handlereplycaps(op, inpart):
1153 """Notify that a reply bundle should be created
1153 """Notify that a reply bundle should be created
1154
1154
@@ -1157,12 +1157,12 b' def handlereplycaps(op, inpart):'
1157 if op.reply is None:
1157 if op.reply is None:
1158 op.reply = bundle20(op.ui, caps)
1158 op.reply = bundle20(op.ui, caps)
1159
1159
1160 @parthandler('b2x:error:abort', ('message', 'hint'))
1160 @parthandler('error:abort', ('message', 'hint'))
1161 def handlereplycaps(op, inpart):
1161 def handlereplycaps(op, inpart):
1162 """Used to transmit abort error over the wire"""
1162 """Used to transmit abort error over the wire"""
1163 raise util.Abort(inpart.params['message'], hint=inpart.params.get('hint'))
1163 raise util.Abort(inpart.params['message'], hint=inpart.params.get('hint'))
1164
1164
1165 @parthandler('b2x:error:unsupportedcontent', ('parttype', 'params'))
1165 @parthandler('error:unsupportedcontent', ('parttype', 'params'))
1166 def handlereplycaps(op, inpart):
1166 def handlereplycaps(op, inpart):
1167 """Used to transmit unknown content error over the wire"""
1167 """Used to transmit unknown content error over the wire"""
1168 kwargs = {}
1168 kwargs = {}
@@ -1175,19 +1175,19 b' def handlereplycaps(op, inpart):'
1175
1175
1176 raise error.UnsupportedPartError(**kwargs)
1176 raise error.UnsupportedPartError(**kwargs)
1177
1177
1178 @parthandler('b2x:error:pushraced', ('message',))
1178 @parthandler('error:pushraced', ('message',))
1179 def handlereplycaps(op, inpart):
1179 def handlereplycaps(op, inpart):
1180 """Used to transmit push race error over the wire"""
1180 """Used to transmit push race error over the wire"""
1181 raise error.ResponseError(_('push failed:'), inpart.params['message'])
1181 raise error.ResponseError(_('push failed:'), inpart.params['message'])
1182
1182
1183 @parthandler('b2x:listkeys', ('namespace',))
1183 @parthandler('listkeys', ('namespace',))
1184 def handlelistkeys(op, inpart):
1184 def handlelistkeys(op, inpart):
1185 """retrieve pushkey namespace content stored in a bundle2"""
1185 """retrieve pushkey namespace content stored in a bundle2"""
1186 namespace = inpart.params['namespace']
1186 namespace = inpart.params['namespace']
1187 r = pushkey.decodekeys(inpart.read())
1187 r = pushkey.decodekeys(inpart.read())
1188 op.records.add('listkeys', (namespace, r))
1188 op.records.add('listkeys', (namespace, r))
1189
1189
1190 @parthandler('b2x:pushkey', ('namespace', 'key', 'old', 'new'))
1190 @parthandler('pushkey', ('namespace', 'key', 'old', 'new'))
1191 def handlepushkey(op, inpart):
1191 def handlepushkey(op, inpart):
1192 """process a pushkey request"""
1192 """process a pushkey request"""
1193 dec = pushkey.decode
1193 dec = pushkey.decode
@@ -1202,18 +1202,18 b' def handlepushkey(op, inpart):'
1202 'new': new}
1202 'new': new}
1203 op.records.add('pushkey', record)
1203 op.records.add('pushkey', record)
1204 if op.reply is not None:
1204 if op.reply is not None:
1205 rpart = op.reply.newpart('b2x:reply:pushkey')
1205 rpart = op.reply.newpart('reply:pushkey')
1206 rpart.addparam('in-reply-to', str(inpart.id), mandatory=False)
1206 rpart.addparam('in-reply-to', str(inpart.id), mandatory=False)
1207 rpart.addparam('return', '%i' % ret, mandatory=False)
1207 rpart.addparam('return', '%i' % ret, mandatory=False)
1208
1208
1209 @parthandler('b2x:reply:pushkey', ('return', 'in-reply-to'))
1209 @parthandler('reply:pushkey', ('return', 'in-reply-to'))
1210 def handlepushkeyreply(op, inpart):
1210 def handlepushkeyreply(op, inpart):
1211 """retrieve the result of a pushkey request"""
1211 """retrieve the result of a pushkey request"""
1212 ret = int(inpart.params['return'])
1212 ret = int(inpart.params['return'])
1213 partid = int(inpart.params['in-reply-to'])
1213 partid = int(inpart.params['in-reply-to'])
1214 op.records.add('pushkey', {'return': ret}, partid)
1214 op.records.add('pushkey', {'return': ret}, partid)
1215
1215
1216 @parthandler('b2x:obsmarkers')
1216 @parthandler('obsmarkers')
1217 def handleobsmarker(op, inpart):
1217 def handleobsmarker(op, inpart):
1218 """add a stream of obsmarkers to the repo"""
1218 """add a stream of obsmarkers to the repo"""
1219 tr = op.gettransaction()
1219 tr = op.gettransaction()
@@ -1222,12 +1222,12 b' def handleobsmarker(op, inpart):'
1222 op.repo.ui.status(_('%i new obsolescence markers\n') % new)
1222 op.repo.ui.status(_('%i new obsolescence markers\n') % new)
1223 op.records.add('obsmarkers', {'new': new})
1223 op.records.add('obsmarkers', {'new': new})
1224 if op.reply is not None:
1224 if op.reply is not None:
1225 rpart = op.reply.newpart('b2x:reply:obsmarkers')
1225 rpart = op.reply.newpart('reply:obsmarkers')
1226 rpart.addparam('in-reply-to', str(inpart.id), mandatory=False)
1226 rpart.addparam('in-reply-to', str(inpart.id), mandatory=False)
1227 rpart.addparam('new', '%i' % new, mandatory=False)
1227 rpart.addparam('new', '%i' % new, mandatory=False)
1228
1228
1229
1229
1230 @parthandler('b2x:reply:obsmarkers', ('new', 'in-reply-to'))
1230 @parthandler('reply:obsmarkers', ('new', 'in-reply-to'))
1231 def handlepushkeyreply(op, inpart):
1231 def handlepushkeyreply(op, inpart):
1232 """retrieve the result of a pushkey request"""
1232 """retrieve the result of a pushkey request"""
1233 ret = int(inpart.params['new'])
1233 ret = int(inpart.params['new'])
@@ -240,7 +240,7 b' class bundlerepository(localrepo.localre'
240
240
241 if isinstance(self.bundle, bundle2.unbundle20):
241 if isinstance(self.bundle, bundle2.unbundle20):
242 cgparts = [part for part in self.bundle.iterparts()
242 cgparts = [part for part in self.bundle.iterparts()
243 if (part.type == 'b2x:changegroup')
243 if (part.type == 'changegroup')
244 and (part.params.get('version', '01')
244 and (part.params.get('version', '01')
245 in changegroup.packermap)]
245 in changegroup.packermap)]
246
246
@@ -71,7 +71,7 b' bundletypes = {'
71 "": ("", nocompress), # only when using unbundle on ssh and old http servers
71 "": ("", nocompress), # only when using unbundle on ssh and old http servers
72 # since the unification ssh accepts a header but there
72 # since the unification ssh accepts a header but there
73 # is no capability signaling it.
73 # is no capability signaling it.
74 "HG2Y": (), # special-cased below
74 "HG20": (), # special-cased below
75 "HG10UN": ("HG10UN", nocompress),
75 "HG10UN": ("HG10UN", nocompress),
76 "HG10BZ": ("HG10", lambda: bz2.BZ2Compressor()),
76 "HG10BZ": ("HG10", lambda: bz2.BZ2Compressor()),
77 "HG10GZ": ("HG10GZ", lambda: zlib.compressobj()),
77 "HG10GZ": ("HG10GZ", lambda: zlib.compressobj()),
@@ -102,10 +102,10 b' def writebundle(ui, cg, filename, bundle'
102 fh = os.fdopen(fd, "wb")
102 fh = os.fdopen(fd, "wb")
103 cleanup = filename
103 cleanup = filename
104
104
105 if bundletype == "HG2Y":
105 if bundletype == "HG20":
106 import bundle2
106 import bundle2
107 bundle = bundle2.bundle20(ui)
107 bundle = bundle2.bundle20(ui)
108 part = bundle.newpart('b2x:changegroup', data=cg.getchunks())
108 part = bundle.newpart('changegroup', data=cg.getchunks())
109 part.addparam('version', cg.version)
109 part.addparam('version', cg.version)
110 z = nocompress()
110 z = nocompress()
111 chunkiter = bundle.getchunks()
111 chunkiter = bundle.getchunks()
@@ -1221,7 +1221,7 b' def bundle(ui, repo, fname, dest=None, *'
1221 btypes = {'none': 'HG10UN',
1221 btypes = {'none': 'HG10UN',
1222 'bzip2': 'HG10BZ',
1222 'bzip2': 'HG10BZ',
1223 'gzip': 'HG10GZ',
1223 'gzip': 'HG10GZ',
1224 'bundle2': 'HG2Y'}
1224 'bundle2': 'HG20'}
1225 bundletype = btypes.get(bundletype)
1225 bundletype = btypes.get(bundletype)
1226 if bundletype not in changegroup.bundletypes:
1226 if bundletype not in changegroup.bundletypes:
1227 raise util.Abort(_('unknown bundle type specified with --type'))
1227 raise util.Abort(_('unknown bundle type specified with --type'))
@@ -1918,7 +1918,7 b' def _debugbundle2(ui, gen, **opts):'
1918 ui.write(('Stream params: %s\n' % repr(gen.params)))
1918 ui.write(('Stream params: %s\n' % repr(gen.params)))
1919 for part in gen.iterparts():
1919 for part in gen.iterparts():
1920 ui.write('%s -- %r\n' % (part.type, repr(part.params)))
1920 ui.write('%s -- %r\n' % (part.type, repr(part.params)))
1921 if part.type == 'b2x:changegroup':
1921 if part.type == 'changegroup':
1922 version = part.params.get('version', '01')
1922 version = part.params.get('version', '01')
1923 cg = changegroup.packermap[version][1](part, 'UN')
1923 cg = changegroup.packermap[version][1](part, 'UN')
1924 chunkdata = cg.changelogheader()
1924 chunkdata = cg.changelogheader()
@@ -2211,7 +2211,7 b' def debuggetbundle(ui, repopath, bundlep'
2211 btypes = {'none': 'HG10UN',
2211 btypes = {'none': 'HG10UN',
2212 'bzip2': 'HG10BZ',
2212 'bzip2': 'HG10BZ',
2213 'gzip': 'HG10GZ',
2213 'gzip': 'HG10GZ',
2214 'bundle2': 'HG2Y'}
2214 'bundle2': 'HG20'}
2215 bundletype = btypes.get(bundletype)
2215 bundletype = btypes.get(bundletype)
2216 if bundletype not in changegroup.bundletypes:
2216 if bundletype not in changegroup.bundletypes:
2217 raise util.Abort(_('unknown bundle type specified with --type'))
2217 raise util.Abort(_('unknown bundle type specified with --type'))
@@ -49,7 +49,7 b' def buildobsmarkerspart(bundler, markers'
49 if version is None:
49 if version is None:
50 raise ValueError('bundler do not support common obsmarker format')
50 raise ValueError('bundler do not support common obsmarker format')
51 stream = obsolete.encodemarkers(markers, True, version=version)
51 stream = obsolete.encodemarkers(markers, True, version=version)
52 return bundler.newpart('b2x:obsmarkers', data=stream)
52 return bundler.newpart('obsmarkers', data=stream)
53 return None
53 return None
54
54
55 def _canusebundle2(op):
55 def _canusebundle2(op):
@@ -57,7 +57,7 b' def _canusebundle2(op):'
57
57
58 Feel free to nuke this function when we drop the experimental option"""
58 Feel free to nuke this function when we drop the experimental option"""
59 return (op.repo.ui.configbool('experimental', 'bundle2-exp', False)
59 return (op.repo.ui.configbool('experimental', 'bundle2-exp', False)
60 and op.remote.capable('bundle2-exp'))
60 and op.remote.capable('bundle2'))
61
61
62
62
63 class pushoperation(object):
63 class pushoperation(object):
@@ -459,10 +459,10 b' def _pushb2ctx(pushop, bundler):'
459 pushop.remote,
459 pushop.remote,
460 pushop.outgoing)
460 pushop.outgoing)
461 if not pushop.force:
461 if not pushop.force:
462 bundler.newpart('b2x:check:heads', data=iter(pushop.remoteheads))
462 bundler.newpart('check:heads', data=iter(pushop.remoteheads))
463 b2caps = bundle2.bundle2caps(pushop.remote)
463 b2caps = bundle2.bundle2caps(pushop.remote)
464 version = None
464 version = None
465 cgversions = b2caps.get('b2x:changegroup')
465 cgversions = b2caps.get('changegroup')
466 if not cgversions: # 3.1 and 3.2 ship with an empty value
466 if not cgversions: # 3.1 and 3.2 ship with an empty value
467 cg = changegroup.getlocalchangegroupraw(pushop.repo, 'push',
467 cg = changegroup.getlocalchangegroupraw(pushop.repo, 'push',
468 pushop.outgoing)
468 pushop.outgoing)
@@ -474,7 +474,7 b' def _pushb2ctx(pushop, bundler):'
474 cg = changegroup.getlocalchangegroupraw(pushop.repo, 'push',
474 cg = changegroup.getlocalchangegroupraw(pushop.repo, 'push',
475 pushop.outgoing,
475 pushop.outgoing,
476 version=version)
476 version=version)
477 cgpart = bundler.newpart('b2x:changegroup', data=cg)
477 cgpart = bundler.newpart('changegroup', data=cg)
478 if version is not None:
478 if version is not None:
479 cgpart.addparam('version', version)
479 cgpart.addparam('version', version)
480 def handlereply(op):
480 def handlereply(op):
@@ -490,13 +490,13 b' def _pushb2phases(pushop, bundler):'
490 if 'phases' in pushop.stepsdone:
490 if 'phases' in pushop.stepsdone:
491 return
491 return
492 b2caps = bundle2.bundle2caps(pushop.remote)
492 b2caps = bundle2.bundle2caps(pushop.remote)
493 if not 'b2x:pushkey' in b2caps:
493 if not 'pushkey' in b2caps:
494 return
494 return
495 pushop.stepsdone.add('phases')
495 pushop.stepsdone.add('phases')
496 part2node = []
496 part2node = []
497 enc = pushkey.encode
497 enc = pushkey.encode
498 for newremotehead in pushop.outdatedphases:
498 for newremotehead in pushop.outdatedphases:
499 part = bundler.newpart('b2x:pushkey')
499 part = bundler.newpart('pushkey')
500 part.addparam('namespace', enc('phases'))
500 part.addparam('namespace', enc('phases'))
501 part.addparam('key', enc(newremotehead.hex()))
501 part.addparam('key', enc(newremotehead.hex()))
502 part.addparam('old', enc(str(phases.draft)))
502 part.addparam('old', enc(str(phases.draft)))
@@ -533,13 +533,13 b' def _pushb2bookmarks(pushop, bundler):'
533 if 'bookmarks' in pushop.stepsdone:
533 if 'bookmarks' in pushop.stepsdone:
534 return
534 return
535 b2caps = bundle2.bundle2caps(pushop.remote)
535 b2caps = bundle2.bundle2caps(pushop.remote)
536 if 'b2x:pushkey' not in b2caps:
536 if 'pushkey' not in b2caps:
537 return
537 return
538 pushop.stepsdone.add('bookmarks')
538 pushop.stepsdone.add('bookmarks')
539 part2book = []
539 part2book = []
540 enc = pushkey.encode
540 enc = pushkey.encode
541 for book, old, new in pushop.outbookmarks:
541 for book, old, new in pushop.outbookmarks:
542 part = bundler.newpart('b2x:pushkey')
542 part = bundler.newpart('pushkey')
543 part.addparam('namespace', enc('bookmarks'))
543 part.addparam('namespace', enc('bookmarks'))
544 part.addparam('key', enc(book))
544 part.addparam('key', enc(book))
545 part.addparam('old', enc(old))
545 part.addparam('old', enc(old))
@@ -583,7 +583,7 b' def _pushbundle2(pushop):'
583 # create reply capability
583 # create reply capability
584 capsblob = bundle2.encodecaps(bundle2.getrepocaps(pushop.repo,
584 capsblob = bundle2.encodecaps(bundle2.getrepocaps(pushop.repo,
585 allowpushback=pushback))
585 allowpushback=pushback))
586 bundler.newpart('b2x:replycaps', data=capsblob)
586 bundler.newpart('replycaps', data=capsblob)
587 replyhandlers = []
587 replyhandlers = []
588 for partgenname in b2partsgenorder:
588 for partgenname in b2partsgenorder:
589 partgen = b2partsgenmapping[partgenname]
589 partgen = b2partsgenmapping[partgenname]
@@ -975,7 +975,7 b' def _pullbundle2(pullop):'
975 kwargs['common'] = pullop.common
975 kwargs['common'] = pullop.common
976 kwargs['heads'] = pullop.heads or pullop.rheads
976 kwargs['heads'] = pullop.heads or pullop.rheads
977 kwargs['cg'] = pullop.fetch
977 kwargs['cg'] = pullop.fetch
978 if 'b2x:listkeys' in remotecaps:
978 if 'listkeys' in remotecaps:
979 kwargs['listkeys'] = ['phase', 'bookmarks']
979 kwargs['listkeys'] = ['phase', 'bookmarks']
980 if not pullop.fetch:
980 if not pullop.fetch:
981 pullop.repo.ui.status(_("no changes found\n"))
981 pullop.repo.ui.status(_("no changes found\n"))
@@ -1128,7 +1128,7 b' def _pullobsolete(pullop):'
1128
1128
1129 def caps20to10(repo):
1129 def caps20to10(repo):
1130 """return a set with appropriate options to use bundle20 during getbundle"""
1130 """return a set with appropriate options to use bundle20 during getbundle"""
1131 caps = set(['HG2Y'])
1131 caps = set(['HG20'])
1132 capsblob = bundle2.encodecaps(bundle2.getrepocaps(repo))
1132 capsblob = bundle2.encodecaps(bundle2.getrepocaps(repo))
1133 caps.add('bundle2=' + urllib.quote(capsblob))
1133 caps.add('bundle2=' + urllib.quote(capsblob))
1134 return caps
1134 return caps
@@ -1161,7 +1161,7 b' def getbundle(repo, source, heads=None, '
1161 **kwargs):
1161 **kwargs):
1162 """return a full bundle (with potentially multiple kind of parts)
1162 """return a full bundle (with potentially multiple kind of parts)
1163
1163
1164 Could be a bundle HG10 or a bundle HG2Y depending on bundlecaps
1164 Could be a bundle HG10 or a bundle HG20 depending on bundlecaps
1165 passed. For now, the bundle can contain only changegroup, but this will
1165 passed. For now, the bundle can contain only changegroup, but this will
1166 changes when more part type will be available for bundle2.
1166 changes when more part type will be available for bundle2.
1167
1167
@@ -1212,7 +1212,7 b' def _getbundlechangegrouppart(bundler, r'
1212 if kwargs.get('cg', True):
1212 if kwargs.get('cg', True):
1213 # build changegroup bundle here.
1213 # build changegroup bundle here.
1214 version = None
1214 version = None
1215 cgversions = b2caps.get('b2x:changegroup')
1215 cgversions = b2caps.get('changegroup')
1216 if not cgversions: # 3.1 and 3.2 ship with an empty value
1216 if not cgversions: # 3.1 and 3.2 ship with an empty value
1217 cg = changegroup.getchangegroupraw(repo, source, heads=heads,
1217 cg = changegroup.getchangegroupraw(repo, source, heads=heads,
1218 common=common,
1218 common=common,
@@ -1228,7 +1228,7 b' def _getbundlechangegrouppart(bundler, r'
1228 version=version)
1228 version=version)
1229
1229
1230 if cg:
1230 if cg:
1231 part = bundler.newpart('b2x:changegroup', data=cg)
1231 part = bundler.newpart('changegroup', data=cg)
1232 if version is not None:
1232 if version is not None:
1233 part.addparam('version', version)
1233 part.addparam('version', version)
1234
1234
@@ -1238,7 +1238,7 b' def _getbundlelistkeysparts(bundler, rep'
1238 """add parts containing listkeys namespaces to the requested bundle"""
1238 """add parts containing listkeys namespaces to the requested bundle"""
1239 listkeys = kwargs.get('listkeys', ())
1239 listkeys = kwargs.get('listkeys', ())
1240 for namespace in listkeys:
1240 for namespace in listkeys:
1241 part = bundler.newpart('b2x:listkeys')
1241 part = bundler.newpart('listkeys')
1242 part.addparam('namespace', namespace)
1242 part.addparam('namespace', namespace)
1243 keys = repo.listkeys(namespace).items()
1243 keys = repo.listkeys(namespace).items()
1244 part.data = pushkey.encodekeys(keys)
1244 part.data = pushkey.encodekeys(keys)
@@ -1288,7 +1288,7 b' def unbundle(repo, cg, heads, source, ur'
1288 tr = repo.transaction('unbundle')
1288 tr = repo.transaction('unbundle')
1289 tr.hookargs['source'] = source
1289 tr.hookargs['source'] = source
1290 tr.hookargs['url'] = url
1290 tr.hookargs['url'] = url
1291 tr.hookargs['bundle2-exp'] = '1'
1291 tr.hookargs['bundle2'] = '1'
1292 r = bundle2.processbundle(repo, cg, lambda: tr).reply
1292 r = bundle2.processbundle(repo, cg, lambda: tr).reply
1293 p = lambda: tr.writepending() and repo.root or ""
1293 p = lambda: tr.writepending() and repo.root or ""
1294 repo.hook('b2x-pretransactionclose', throw=True, pending=p,
1294 repo.hook('b2x-pretransactionclose', throw=True, pending=p,
@@ -110,7 +110,7 b' class localpeer(peer.peerrepository):'
110 **kwargs):
110 **kwargs):
111 cg = exchange.getbundle(self._repo, source, heads=heads,
111 cg = exchange.getbundle(self._repo, source, heads=heads,
112 common=common, bundlecaps=bundlecaps, **kwargs)
112 common=common, bundlecaps=bundlecaps, **kwargs)
113 if bundlecaps is not None and 'HG2Y' in bundlecaps:
113 if bundlecaps is not None and 'HG20' in bundlecaps:
114 # When requesting a bundle2, getbundle returns a stream to make the
114 # When requesting a bundle2, getbundle returns a stream to make the
115 # wire level function happier. We need to build a proper object
115 # wire level function happier. We need to build a proper object
116 # from it in local peer.
116 # from it in local peer.
@@ -317,7 +317,7 b' class localrepository(object):'
317 if self.ui.configbool('experimental', 'bundle2-exp', False):
317 if self.ui.configbool('experimental', 'bundle2-exp', False):
318 caps = set(caps)
318 caps = set(caps)
319 capsblob = bundle2.encodecaps(bundle2.getrepocaps(self))
319 capsblob = bundle2.encodecaps(bundle2.getrepocaps(self))
320 caps.add('bundle2-exp=' + urllib.quote(capsblob))
320 caps.add('bundle2=' + urllib.quote(capsblob))
321 return caps
321 return caps
322
322
323 def _applyrequirements(self, requirements):
323 def _applyrequirements(self, requirements):
@@ -42,7 +42,7 b' def _bundle(repo, bases, heads, node, su'
42 name = "%s/%s-%s-%s.hg" % (backupdir, short(node), totalhash[:8], suffix)
42 name = "%s/%s-%s-%s.hg" % (backupdir, short(node), totalhash[:8], suffix)
43
43
44 if usebundle2:
44 if usebundle2:
45 bundletype = "HG2Y"
45 bundletype = "HG20"
46 elif compress:
46 elif compress:
47 bundletype = "HG10BZ"
47 bundletype = "HG10BZ"
48 else:
48 else:
@@ -617,7 +617,7 b' def _capabilities(repo, proto):'
617 caps.append('streamreqs=%s' % ','.join(requiredformats))
617 caps.append('streamreqs=%s' % ','.join(requiredformats))
618 if repo.ui.configbool('experimental', 'bundle2-exp', False):
618 if repo.ui.configbool('experimental', 'bundle2-exp', False):
619 capsblob = bundle2.encodecaps(bundle2.getrepocaps(repo))
619 capsblob = bundle2.encodecaps(bundle2.getrepocaps(repo))
620 caps.append('bundle2-exp=' + urllib.quote(capsblob))
620 caps.append('bundle2=' + urllib.quote(capsblob))
621 caps.append('unbundle=%s' % ','.join(changegroupmod.bundlepriority))
621 caps.append('unbundle=%s' % ','.join(changegroupmod.bundlepriority))
622 caps.append('httpheader=1024')
622 caps.append('httpheader=1024')
623 return caps
623 return caps
@@ -843,7 +843,7 b' def unbundle(repo, proto, heads):'
843 os.unlink(tempname)
843 os.unlink(tempname)
844 except error.BundleValueError, exc:
844 except error.BundleValueError, exc:
845 bundler = bundle2.bundle20(repo.ui)
845 bundler = bundle2.bundle20(repo.ui)
846 errpart = bundler.newpart('b2x:error:unsupportedcontent')
846 errpart = bundler.newpart('error:unsupportedcontent')
847 if exc.parttype is not None:
847 if exc.parttype is not None:
848 errpart.addparam('parttype', exc.parttype)
848 errpart.addparam('parttype', exc.parttype)
849 if exc.params:
849 if exc.params:
@@ -860,7 +860,7 b' def unbundle(repo, proto, heads):'
860 advargs = []
860 advargs = []
861 if inst.hint is not None:
861 if inst.hint is not None:
862 advargs.append(('hint', inst.hint))
862 advargs.append(('hint', inst.hint))
863 bundler.addpart(bundle2.bundlepart('b2x:error:abort',
863 bundler.addpart(bundle2.bundlepart('error:abort',
864 manargs, advargs))
864 manargs, advargs))
865 return streamres(bundler.getchunks())
865 return streamres(bundler.getchunks())
866 else:
866 else:
@@ -869,7 +869,7 b' def unbundle(repo, proto, heads):'
869 except error.PushRaced, exc:
869 except error.PushRaced, exc:
870 if getattr(exc, 'duringunbundle2', False):
870 if getattr(exc, 'duringunbundle2', False):
871 bundler = bundle2.bundle20(repo.ui)
871 bundler = bundle2.bundle20(repo.ui)
872 bundler.newpart('b2x:error:pushraced', [('message', str(exc))])
872 bundler.newpart('error:pushraced', [('message', str(exc))])
873 return streamres(bundler.getchunks())
873 return streamres(bundler.getchunks())
874 else:
874 else:
875 return pusherr(str(exc))
875 return pusherr(str(exc))
@@ -220,7 +220,7 b' push'
220 lock: free
220 lock: free
221 wlock: free
221 wlock: free
222 postclose-tip:eea13746799a public book_eea1
222 postclose-tip:eea13746799a public book_eea1
223 txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=1 HG_NODE=eea13746799a9e0bfd88f29d3c2e9dc9389f524f HG_PHASES_MOVED=1 HG_SOURCE=push HG_TXNNAME=unbundle HG_URL=push
223 txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_NEW_OBSMARKERS=1 HG_NODE=eea13746799a9e0bfd88f29d3c2e9dc9389f524f HG_PHASES_MOVED=1 HG_SOURCE=push HG_TXNNAME=unbundle HG_URL=push
224 remote: adding changesets
224 remote: adding changesets
225 remote: adding manifests
225 remote: adding manifests
226 remote: adding file changes
226 remote: adding file changes
@@ -310,7 +310,7 b' push over ssh'
310 remote: lock: free
310 remote: lock: free
311 remote: wlock: free
311 remote: wlock: free
312 remote: postclose-tip:5fddd98957c8 draft book_5fdd
312 remote: postclose-tip:5fddd98957c8 draft book_5fdd
313 remote: txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=1 HG_NODE=5fddd98957c8a54a4d436dfe1da9d87f21a1b97b HG_SOURCE=serve HG_TXNNAME=unbundle HG_URL=remote:ssh:127.0.0.1
313 remote: txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_NEW_OBSMARKERS=1 HG_NODE=5fddd98957c8a54a4d436dfe1da9d87f21a1b97b HG_SOURCE=serve HG_TXNNAME=unbundle HG_URL=remote:ssh:127.0.0.1
314 pre-close-tip:02de42196ebe draft book_02de
314 pre-close-tip:02de42196ebe draft book_02de
315 postclose-tip:02de42196ebe draft book_02de
315 postclose-tip:02de42196ebe draft book_02de
316 txnclose hook: HG_SOURCE=push-response HG_TXNNAME=push-response
316 txnclose hook: HG_SOURCE=push-response HG_TXNNAME=push-response
@@ -426,7 +426,7 b' Setting up'
426 > bundler.newpart('test:unknown')
426 > bundler.newpart('test:unknown')
427 > if reason == 'race':
427 > if reason == 'race':
428 > # 20 Bytes of crap
428 > # 20 Bytes of crap
429 > bundler.newpart('b2x:check:heads', data='01234567890123456789')
429 > bundler.newpart('check:heads', data='01234567890123456789')
430 >
430 >
431 > @bundle2.parthandler("test:abort")
431 > @bundle2.parthandler("test:abort")
432 > def handleabort(op, part):
432 > def handleabort(op, part):
@@ -92,11 +92,11 b' Create an extension to test bundle2 API'
92 >
92 >
93 > if opts['reply']:
93 > if opts['reply']:
94 > capsstring = 'ping-pong\nelephants=babar,celeste\ncity%3D%21=celeste%2Cville'
94 > capsstring = 'ping-pong\nelephants=babar,celeste\ncity%3D%21=celeste%2Cville'
95 > bundler.newpart('b2x:replycaps', data=capsstring)
95 > bundler.newpart('replycaps', data=capsstring)
96 >
96 >
97 > if opts['pushrace']:
97 > if opts['pushrace']:
98 > # also serve to test the assignement of data outside of init
98 > # also serve to test the assignement of data outside of init
99 > part = bundler.newpart('b2x:check:heads')
99 > part = bundler.newpart('check:heads')
100 > part.data = '01234567890123456789'
100 > part.data = '01234567890123456789'
101 >
101 >
102 > revs = opts['rev']
102 > revs = opts['rev']
@@ -109,7 +109,7 b' Create an extension to test bundle2 API'
109 > headcommon = [c.node() for c in repo.set('parents(%ld) - %ld', revs, revs)]
109 > headcommon = [c.node() for c in repo.set('parents(%ld) - %ld', revs, revs)]
110 > outgoing = discovery.outgoing(repo.changelog, headcommon, headmissing)
110 > outgoing = discovery.outgoing(repo.changelog, headcommon, headmissing)
111 > cg = changegroup.getlocalchangegroup(repo, 'test:bundle2', outgoing, None)
111 > cg = changegroup.getlocalchangegroup(repo, 'test:bundle2', outgoing, None)
112 > bundler.newpart('b2x:changegroup', data=cg.getchunks(),
112 > bundler.newpart('changegroup', data=cg.getchunks(),
113 > mandatory=False)
113 > mandatory=False)
114 >
114 >
115 > if opts['parts']:
115 > if opts['parts']:
@@ -136,7 +136,7 b' Create an extension to test bundle2 API'
136 > def genraise():
136 > def genraise():
137 > yield 'first line\n'
137 > yield 'first line\n'
138 > raise RuntimeError('Someone set up us the bomb!')
138 > raise RuntimeError('Someone set up us the bomb!')
139 > bundler.newpart('b2x:output', data=genraise(), mandatory=False)
139 > bundler.newpart('output', data=genraise(), mandatory=False)
140 >
140 >
141 > if path is None:
141 > if path is None:
142 > file = sys.stdout
142 > file = sys.stdout
@@ -237,7 +237,7 b' Empty bundle'
237 Test bundling
237 Test bundling
238
238
239 $ hg bundle2
239 $ hg bundle2
240 HG2Y\x00\x00\x00\x00\x00\x00\x00\x00 (no-eol) (esc)
240 HG20\x00\x00\x00\x00\x00\x00\x00\x00 (no-eol) (esc)
241
241
242 Test unbundling
242 Test unbundling
243
243
@@ -267,7 +267,7 b' Simplest possible parameters form'
267 Test generation simple option
267 Test generation simple option
268
268
269 $ hg bundle2 --param 'caution'
269 $ hg bundle2 --param 'caution'
270 HG2Y\x00\x00\x00\x07caution\x00\x00\x00\x00 (no-eol) (esc)
270 HG20\x00\x00\x00\x07caution\x00\x00\x00\x00 (no-eol) (esc)
271
271
272 Test unbundling
272 Test unbundling
273
273
@@ -279,7 +279,7 b' Test unbundling'
279 Test generation multiple option
279 Test generation multiple option
280
280
281 $ hg bundle2 --param 'caution' --param 'meal'
281 $ hg bundle2 --param 'caution' --param 'meal'
282 HG2Y\x00\x00\x00\x0ccaution meal\x00\x00\x00\x00 (no-eol) (esc)
282 HG20\x00\x00\x00\x0ccaution meal\x00\x00\x00\x00 (no-eol) (esc)
283
283
284 Test unbundling
284 Test unbundling
285
285
@@ -295,7 +295,7 b' advisory parameters, with value'
295 Test generation
295 Test generation
296
296
297 $ hg bundle2 --param 'caution' --param 'meal=vegan' --param 'elephants'
297 $ hg bundle2 --param 'caution' --param 'meal=vegan' --param 'elephants'
298 HG2Y\x00\x00\x00\x1ccaution meal=vegan elephants\x00\x00\x00\x00 (no-eol) (esc)
298 HG20\x00\x00\x00\x1ccaution meal=vegan elephants\x00\x00\x00\x00 (no-eol) (esc)
299
299
300 Test unbundling
300 Test unbundling
301
301
@@ -313,7 +313,7 b' parameter with special char in value'
313 Test generation
313 Test generation
314
314
315 $ hg bundle2 --param 'e|! 7/=babar%#==tutu' --param simple
315 $ hg bundle2 --param 'e|! 7/=babar%#==tutu' --param simple
316 HG2Y\x00\x00\x00)e%7C%21%207/=babar%25%23%3D%3Dtutu simple\x00\x00\x00\x00 (no-eol) (esc)
316 HG20\x00\x00\x00)e%7C%21%207/=babar%25%23%3D%3Dtutu simple\x00\x00\x00\x00 (no-eol) (esc)
317
317
318 Test unbundling
318 Test unbundling
319
319
@@ -337,7 +337,7 b' Test debug output'
337 bundling debug
337 bundling debug
338
338
339 $ hg bundle2 --debug --param 'e|! 7/=babar%#==tutu' --param simple ../out.hg2
339 $ hg bundle2 --debug --param 'e|! 7/=babar%#==tutu' --param simple ../out.hg2
340 start emission of HG2Y stream
340 start emission of HG20 stream
341 bundle parameter: e%7C%21%207/=babar%25%23%3D%3Dtutu simple
341 bundle parameter: e%7C%21%207/=babar%25%23%3D%3Dtutu simple
342 start of parts
342 start of parts
343 end of bundle
343 end of bundle
@@ -345,12 +345,12 b' bundling debug'
345 file content is ok
345 file content is ok
346
346
347 $ cat ../out.hg2
347 $ cat ../out.hg2
348 HG2Y\x00\x00\x00)e%7C%21%207/=babar%25%23%3D%3Dtutu simple\x00\x00\x00\x00 (no-eol) (esc)
348 HG20\x00\x00\x00)e%7C%21%207/=babar%25%23%3D%3Dtutu simple\x00\x00\x00\x00 (no-eol) (esc)
349
349
350 unbundling debug
350 unbundling debug
351
351
352 $ hg statbundle2 --debug < ../out.hg2
352 $ hg statbundle2 --debug < ../out.hg2
353 start processing of HG2Y stream
353 start processing of HG20 stream
354 reading bundle2 stream parameters
354 reading bundle2 stream parameters
355 ignoring unknown parameter 'e|! 7/'
355 ignoring unknown parameter 'e|! 7/'
356 ignoring unknown parameter 'simple'
356 ignoring unknown parameter 'simple'
@@ -384,7 +384,7 b' Test part'
384 =================
384 =================
385
385
386 $ hg bundle2 --parts ../parts.hg2 --debug
386 $ hg bundle2 --parts ../parts.hg2 --debug
387 start emission of HG2Y stream
387 start emission of HG20 stream
388 bundle parameter:
388 bundle parameter:
389 start of parts
389 start of parts
390 bundle part: "test:empty"
390 bundle part: "test:empty"
@@ -397,7 +397,7 b' Test part'
397 end of bundle
397 end of bundle
398
398
399 $ cat ../parts.hg2
399 $ cat ../parts.hg2
400 HG2Y\x00\x00\x00\x00\x00\x00\x00\x11 (esc)
400 HG20\x00\x00\x00\x00\x00\x00\x00\x11 (esc)
401 test:empty\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11 (esc)
401 test:empty\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11 (esc)
402 test:empty\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10 test:song\x00\x00\x00\x02\x00\x00\x00\x00\x00\xb2Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko (esc)
402 test:empty\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10 test:song\x00\x00\x00\x02\x00\x00\x00\x00\x00\xb2Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko (esc)
403 Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko
403 Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko
@@ -437,7 +437,7 b' Test part'
437 parts count: 7
437 parts count: 7
438
438
439 $ hg statbundle2 --debug < ../parts.hg2
439 $ hg statbundle2 --debug < ../parts.hg2
440 start processing of HG2Y stream
440 start processing of HG20 stream
441 reading bundle2 stream parameters
441 reading bundle2 stream parameters
442 options count: 0
442 options count: 0
443 start extraction of bundle2 parts
443 start extraction of bundle2 parts
@@ -516,7 +516,7 b' Test actual unbundling of test part'
516 Process the bundle
516 Process the bundle
517
517
518 $ hg unbundle2 --debug < ../parts.hg2
518 $ hg unbundle2 --debug < ../parts.hg2
519 start processing of HG2Y stream
519 start processing of HG20 stream
520 reading bundle2 stream parameters
520 reading bundle2 stream parameters
521 start extraction of bundle2 parts
521 start extraction of bundle2 parts
522 part header size: 17
522 part header size: 17
@@ -610,21 +610,18 b' unbundle with a reply'
610 The reply is a bundle
610 The reply is a bundle
611
611
612 $ cat ../reply.hg2
612 $ cat ../reply.hg2
613 HG2Y\x00\x00\x00\x00\x00\x00\x00\x1f (esc)
613 HG20\x00\x00\x00\x00\x00\x00\x00\x1b\x06output\x00\x00\x00\x00\x00\x01\x0b\x01in-reply-to3\x00\x00\x00\xd9The choir starts singing: (esc)
614 b2x:output\x00\x00\x00\x00\x00\x01\x0b\x01in-reply-to3\x00\x00\x00\xd9The choir starts singing: (esc)
615 Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko
614 Patali Dirapata, Cromda Cromda Ripalo, Pata Pata, Ko Ko Ko
616 Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko
615 Bokoro Dipoulito, Rondi Rondi Pepino, Pata Pata, Ko Ko Ko
617 Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko.
616 Emana Karassoli, Loucra Loucra Ponponto, Pata Pata, Ko Ko Ko.
618 \x00\x00\x00\x00\x00\x00\x00\x1f (esc)
617 \x00\x00\x00\x00\x00\x00\x00\x1b\x06output\x00\x00\x00\x01\x00\x01\x0b\x01in-reply-to4\x00\x00\x00\xc9debugreply: capabilities: (esc)
619 b2x:output\x00\x00\x00\x01\x00\x01\x0b\x01in-reply-to4\x00\x00\x00\xc9debugreply: capabilities: (esc)
620 debugreply: 'city=!'
618 debugreply: 'city=!'
621 debugreply: 'celeste,ville'
619 debugreply: 'celeste,ville'
622 debugreply: 'elephants'
620 debugreply: 'elephants'
623 debugreply: 'babar'
621 debugreply: 'babar'
624 debugreply: 'celeste'
622 debugreply: 'celeste'
625 debugreply: 'ping-pong'
623 debugreply: 'ping-pong'
626 \x00\x00\x00\x00\x00\x00\x00\x1e test:pong\x00\x00\x00\x02\x01\x00\x0b\x01in-reply-to7\x00\x00\x00\x00\x00\x00\x00\x1f (esc)
624 \x00\x00\x00\x00\x00\x00\x00\x1e test:pong\x00\x00\x00\x02\x01\x00\x0b\x01in-reply-to7\x00\x00\x00\x00\x00\x00\x00\x1b\x06output\x00\x00\x00\x03\x00\x01\x0b\x01in-reply-to7\x00\x00\x00=received ping request (id 7) (esc)
627 b2x:output\x00\x00\x00\x03\x00\x01\x0b\x01in-reply-to7\x00\x00\x00=received ping request (id 7) (esc)
628 replying to ping request (id 7)
625 replying to ping request (id 7)
629 \x00\x00\x00\x00\x00\x00\x00\x00 (no-eol) (esc)
626 \x00\x00\x00\x00\x00\x00\x00\x00 (no-eol) (esc)
630
627
@@ -632,11 +629,11 b' The reply is valid'
632
629
633 $ hg statbundle2 < ../reply.hg2
630 $ hg statbundle2 < ../reply.hg2
634 options count: 0
631 options count: 0
635 :b2x:output:
632 :output:
636 mandatory: 0
633 mandatory: 0
637 advisory: 1
634 advisory: 1
638 payload: 217 bytes
635 payload: 217 bytes
639 :b2x:output:
636 :output:
640 mandatory: 0
637 mandatory: 0
641 advisory: 1
638 advisory: 1
642 payload: 201 bytes
639 payload: 201 bytes
@@ -644,7 +641,7 b' The reply is valid'
644 mandatory: 1
641 mandatory: 1
645 advisory: 0
642 advisory: 0
646 payload: 0 bytes
643 payload: 0 bytes
647 :b2x:output:
644 :output:
648 mandatory: 0
645 mandatory: 0
649 advisory: 1
646 advisory: 1
650 payload: 61 bytes
647 payload: 61 bytes
@@ -714,10 +711,10 b' Support for changegroup'
714 9520eea781bcca16c1e15acc0ba14335a0e8e5ba
711 9520eea781bcca16c1e15acc0ba14335a0e8e5ba
715 eea13746799a9e0bfd88f29d3c2e9dc9389f524f
712 eea13746799a9e0bfd88f29d3c2e9dc9389f524f
716 02de42196ebee42ef284b6780a87cdc96e8eaab6
713 02de42196ebee42ef284b6780a87cdc96e8eaab6
717 start emission of HG2Y stream
714 start emission of HG20 stream
718 bundle parameter:
715 bundle parameter:
719 start of parts
716 start of parts
720 bundle part: "b2x:changegroup"
717 bundle part: "changegroup"
721 bundling: 1/4 changesets (25.00%)
718 bundling: 1/4 changesets (25.00%)
722 bundling: 2/4 changesets (50.00%)
719 bundling: 2/4 changesets (50.00%)
723 bundling: 3/4 changesets (75.00%)
720 bundling: 3/4 changesets (75.00%)
@@ -732,7 +729,7 b' Support for changegroup'
732 end of bundle
729 end of bundle
733
730
734 $ cat ../rev.hg2
731 $ cat ../rev.hg2
735 HG2Y\x00\x00\x00\x00\x00\x00\x00\x16\x0fb2x:changegroup\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)
732 HG20\x00\x00\x00\x00\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)
736 \x00\x00\x00f\x00\x00\x00h\x00\x00\x00\x02D (esc)
733 \x00\x00\x00f\x00\x00\x00h\x00\x00\x00\x02D (esc)
737 \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)
734 \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)
738 \x00\x00\x00f\x00\x00\x00h\x00\x00\x00\x02E (esc)
735 \x00\x00\x00f\x00\x00\x00h\x00\x00\x00\x02E (esc)
@@ -757,7 +754,7 b' Support for changegroup'
757
754
758 $ hg debugbundle ../rev.hg2
755 $ hg debugbundle ../rev.hg2
759 Stream params: {}
756 Stream params: {}
760 b2x:changegroup -- '{}'
757 changegroup -- '{}'
761 32af7686d403cf45b5d95f2d70cebea587ac806a
758 32af7686d403cf45b5d95f2d70cebea587ac806a
762 9520eea781bcca16c1e15acc0ba14335a0e8e5ba
759 9520eea781bcca16c1e15acc0ba14335a0e8e5ba
763 eea13746799a9e0bfd88f29d3c2e9dc9389f524f
760 eea13746799a9e0bfd88f29d3c2e9dc9389f524f
@@ -776,8 +773,7 b' with reply'
776 addchangegroup return: 1
773 addchangegroup return: 1
777
774
778 $ cat ../rev-reply.hg2
775 $ cat ../rev-reply.hg2
779 HG2Y\x00\x00\x00\x00\x00\x00\x003\x15b2x:reply:changegroup\x00\x00\x00\x00\x00\x02\x0b\x01\x06\x01in-reply-to1return1\x00\x00\x00\x00\x00\x00\x00\x1f (esc)
776 HG20\x00\x00\x00\x00\x00\x00\x00/\x11reply:changegroup\x00\x00\x00\x00\x00\x02\x0b\x01\x06\x01in-reply-to1return1\x00\x00\x00\x00\x00\x00\x00\x1b\x06output\x00\x00\x00\x01\x00\x01\x0b\x01in-reply-to1\x00\x00\x00dadding changesets (esc)
780 b2x:output\x00\x00\x00\x01\x00\x01\x0b\x01in-reply-to1\x00\x00\x00dadding changesets (esc)
781 adding manifests
777 adding manifests
782 adding file changes
778 adding file changes
783 added 0 changesets with 0 changes to 3 files
779 added 0 changesets with 0 changes to 3 files
@@ -793,8 +789,8 b' Check handling of exception during gener'
793 Should still be a valid bundle
789 Should still be a valid bundle
794
790
795 $ cat ../genfailed.hg2
791 $ cat ../genfailed.hg2
796 HG2Y\x00\x00\x00\x00\x00\x00\x00\x11 (esc)
792 HG20\x00\x00\x00\x00\x00\x00\x00\r (no-eol) (esc)
797 b2x:output\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00L\x0fb2x:error:abort\x00\x00\x00\x00\x01\x00\x07-messageunexpected error: Someone set up us the bomb!\x00\x00\x00\x00\x00\x00\x00\x00 (no-eol) (esc)
793 \x06output\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00H\x0berror:abort\x00\x00\x00\x00\x01\x00\x07-messageunexpected error: Someone set up us the bomb!\x00\x00\x00\x00\x00\x00\x00\x00 (no-eol) (esc)
798
794
799 And its handling on the other size raise a clean exception
795 And its handling on the other size raise a clean exception
800
796
@@ -14,13 +14,13 b' Create an extension to test bundle2 with'
14 > intermediates = [repo[r].p1().node() for r in heads]
14 > intermediates = [repo[r].p1().node() for r in heads]
15 > cg = changegroup.getchangegroup(repo, source, heads=intermediates,
15 > cg = changegroup.getchangegroup(repo, source, heads=intermediates,
16 > common=common, bundlecaps=bundlecaps)
16 > common=common, bundlecaps=bundlecaps)
17 > bundler.newpart('b2x:output', data='changegroup1')
17 > bundler.newpart('output', data='changegroup1')
18 > bundler.newpart('b2x:changegroup', data=cg.getchunks())
18 > bundler.newpart('changegroup', data=cg.getchunks())
19 > cg = changegroup.getchangegroup(repo, source, heads=heads,
19 > cg = changegroup.getchangegroup(repo, source, heads=heads,
20 > common=common + intermediates,
20 > common=common + intermediates,
21 > bundlecaps=bundlecaps)
21 > bundlecaps=bundlecaps)
22 > bundler.newpart('b2x:output', data='changegroup2')
22 > bundler.newpart('output', data='changegroup2')
23 > bundler.newpart('b2x:changegroup', data=cg.getchunks())
23 > bundler.newpart('changegroup', data=cg.getchunks())
24 >
24 >
25 > def _pull(repo, *args, **kwargs):
25 > def _pull(repo, *args, **kwargs):
26 > pullop = _orig_pull(repo, *args, **kwargs)
26 > pullop = _orig_pull(repo, *args, **kwargs)
@@ -6,21 +6,21 b''
6 > from mercurial import bundle2, pushkey, exchange, util
6 > from mercurial import bundle2, pushkey, exchange, util
7 > def _newhandlechangegroup(op, inpart):
7 > def _newhandlechangegroup(op, inpart):
8 > """This function wraps the changegroup part handler for getbundle.
8 > """This function wraps the changegroup part handler for getbundle.
9 > It issues an additional b2x:pushkey part to send a new
9 > It issues an additional pushkey part to send a new
10 > bookmark back to the client"""
10 > bookmark back to the client"""
11 > result = bundle2.handlechangegroup(op, inpart)
11 > result = bundle2.handlechangegroup(op, inpart)
12 > if 'b2x:pushback' in op.reply.capabilities:
12 > if 'pushback' in op.reply.capabilities:
13 > params = {'namespace': 'bookmarks',
13 > params = {'namespace': 'bookmarks',
14 > 'key': 'new-server-mark',
14 > 'key': 'new-server-mark',
15 > 'old': '',
15 > 'old': '',
16 > 'new': 'tip'}
16 > 'new': 'tip'}
17 > encodedparams = [(k, pushkey.encode(v)) for (k,v) in params.items()]
17 > encodedparams = [(k, pushkey.encode(v)) for (k,v) in params.items()]
18 > op.reply.newpart('b2x:pushkey', mandatoryparams=encodedparams)
18 > op.reply.newpart('pushkey', mandatoryparams=encodedparams)
19 > else:
19 > else:
20 > op.reply.newpart('b2x:output', data='pushback not enabled')
20 > op.reply.newpart('output', data='pushback not enabled')
21 > return result
21 > return result
22 > _newhandlechangegroup.params = bundle2.handlechangegroup.params
22 > _newhandlechangegroup.params = bundle2.handlechangegroup.params
23 > bundle2.parthandlermapping['b2x:changegroup'] = _newhandlechangegroup
23 > bundle2.parthandlermapping['changegroup'] = _newhandlechangegroup
24 > EOF
24 > EOF
25
25
26 $ cat >> $HGRCPATH <<EOF
26 $ cat >> $HGRCPATH <<EOF
@@ -35,7 +35,7 b' Create an extension to test bundle2 remo'
35 > def newpart(name, data=''):
35 > def newpart(name, data=''):
36 > """wrapper around bundler.newpart adding an extra part making the
36 > """wrapper around bundler.newpart adding an extra part making the
37 > client output information about each processed part"""
37 > client output information about each processed part"""
38 > bundler.newpart('b2x:output', data=name)
38 > bundler.newpart('output', data=name)
39 > part = bundler.newpart(name, data=data)
39 > part = bundler.newpart(name, data=data)
40 > return part
40 > return part
41 >
41 >
@@ -50,13 +50,13 b' Create an extension to test bundle2 remo'
50 > bundledata = open(file, 'rb').read()
50 > bundledata = open(file, 'rb').read()
51 > digest = util.digester.preferred(b2caps['digests'])
51 > digest = util.digester.preferred(b2caps['digests'])
52 > d = util.digester([digest], bundledata)
52 > d = util.digester([digest], bundledata)
53 > part = newpart('b2x:remote-changegroup')
53 > part = newpart('remote-changegroup')
54 > part.addparam('url', url)
54 > part.addparam('url', url)
55 > part.addparam('size', str(len(bundledata)))
55 > part.addparam('size', str(len(bundledata)))
56 > part.addparam('digests', digest)
56 > part.addparam('digests', digest)
57 > part.addparam('digest:%s' % digest, d[digest])
57 > part.addparam('digest:%s' % digest, d[digest])
58 > elif verb == 'raw-remote-changegroup':
58 > elif verb == 'raw-remote-changegroup':
59 > part = newpart('b2x:remote-changegroup')
59 > part = newpart('remote-changegroup')
60 > for k, v in eval(args).items():
60 > for k, v in eval(args).items():
61 > part.addparam(k, str(v))
61 > part.addparam(k, str(v))
62 > elif verb == 'changegroup':
62 > elif verb == 'changegroup':
@@ -65,7 +65,7 b' Create an extension to test bundle2 remo'
65 > heads = [repo.lookup(r) for r in repo.revs(heads)]
65 > heads = [repo.lookup(r) for r in repo.revs(heads)]
66 > cg = changegroup.getchangegroup(repo, 'changegroup',
66 > cg = changegroup.getchangegroup(repo, 'changegroup',
67 > heads=heads, common=common)
67 > heads=heads, common=common)
68 > newpart('b2x:changegroup', cg.getchunks())
68 > newpart('changegroup', cg.getchunks())
69 > else:
69 > else:
70 > raise Exception('unknown verb')
70 > raise Exception('unknown verb')
71 >
71 >
@@ -137,7 +137,7 b' Test a pull with an remote-changegroup'
137 $ hg pull -R clone ssh://user@dummy/repo
137 $ hg pull -R clone ssh://user@dummy/repo
138 pulling from ssh://user@dummy/repo
138 pulling from ssh://user@dummy/repo
139 searching for changes
139 searching for changes
140 remote: b2x:remote-changegroup
140 remote: remote-changegroup
141 adding changesets
141 adding changesets
142 adding manifests
142 adding manifests
143 adding file changes
143 adding file changes
@@ -180,12 +180,12 b' Test a pull with an remote-changegroup a'
180 $ hg pull -R clone ssh://user@dummy/repo
180 $ hg pull -R clone ssh://user@dummy/repo
181 pulling from ssh://user@dummy/repo
181 pulling from ssh://user@dummy/repo
182 searching for changes
182 searching for changes
183 remote: b2x:remote-changegroup
183 remote: remote-changegroup
184 adding changesets
184 adding changesets
185 adding manifests
185 adding manifests
186 adding file changes
186 adding file changes
187 added 2 changesets with 2 changes to 2 files (+1 heads)
187 added 2 changesets with 2 changes to 2 files (+1 heads)
188 remote: b2x:changegroup
188 remote: changegroup
189 adding changesets
189 adding changesets
190 adding manifests
190 adding manifests
191 adding file changes
191 adding file changes
@@ -228,12 +228,12 b' Test a pull with a changegroup followed '
228 $ hg pull -R clone ssh://user@dummy/repo
228 $ hg pull -R clone ssh://user@dummy/repo
229 pulling from ssh://user@dummy/repo
229 pulling from ssh://user@dummy/repo
230 searching for changes
230 searching for changes
231 remote: b2x:changegroup
231 remote: changegroup
232 adding changesets
232 adding changesets
233 adding manifests
233 adding manifests
234 adding file changes
234 adding file changes
235 added 2 changesets with 2 changes to 2 files (+1 heads)
235 added 2 changesets with 2 changes to 2 files (+1 heads)
236 remote: b2x:remote-changegroup
236 remote: remote-changegroup
237 adding changesets
237 adding changesets
238 adding manifests
238 adding manifests
239 adding file changes
239 adding file changes
@@ -279,17 +279,17 b' Test a pull with two remote-changegroups'
279 $ hg pull -R clone ssh://user@dummy/repo
279 $ hg pull -R clone ssh://user@dummy/repo
280 pulling from ssh://user@dummy/repo
280 pulling from ssh://user@dummy/repo
281 searching for changes
281 searching for changes
282 remote: b2x:remote-changegroup
282 remote: remote-changegroup
283 adding changesets
283 adding changesets
284 adding manifests
284 adding manifests
285 adding file changes
285 adding file changes
286 added 2 changesets with 2 changes to 2 files (+1 heads)
286 added 2 changesets with 2 changes to 2 files (+1 heads)
287 remote: b2x:remote-changegroup
287 remote: remote-changegroup
288 adding changesets
288 adding changesets
289 adding manifests
289 adding manifests
290 adding file changes
290 adding file changes
291 added 2 changesets with 1 changes to 1 files
291 added 2 changesets with 1 changes to 1 files
292 remote: b2x:changegroup
292 remote: changegroup
293 adding changesets
293 adding changesets
294 adding manifests
294 adding manifests
295 adding file changes
295 adding file changes
@@ -324,7 +324,7 b' Hash digest tests'
324 > EOF
324 > EOF
325 $ hg clone ssh://user@dummy/repo clone
325 $ hg clone ssh://user@dummy/repo clone
326 requesting all changes
326 requesting all changes
327 remote: b2x:remote-changegroup
327 remote: remote-changegroup
328 adding changesets
328 adding changesets
329 adding manifests
329 adding manifests
330 adding file changes
330 adding file changes
@@ -338,7 +338,7 b' Hash digest tests'
338 > EOF
338 > EOF
339 $ hg clone ssh://user@dummy/repo clone
339 $ hg clone ssh://user@dummy/repo clone
340 requesting all changes
340 requesting all changes
341 remote: b2x:remote-changegroup
341 remote: remote-changegroup
342 adding changesets
342 adding changesets
343 adding manifests
343 adding manifests
344 adding file changes
344 adding file changes
@@ -354,7 +354,7 b' Hash digest mismatch throws an error'
354 > EOF
354 > EOF
355 $ hg clone ssh://user@dummy/repo clone
355 $ hg clone ssh://user@dummy/repo clone
356 requesting all changes
356 requesting all changes
357 remote: b2x:remote-changegroup
357 remote: remote-changegroup
358 adding changesets
358 adding changesets
359 adding manifests
359 adding manifests
360 adding file changes
360 adding file changes
@@ -372,7 +372,7 b' Multiple hash digests can be given'
372 > EOF
372 > EOF
373 $ hg clone ssh://user@dummy/repo clone
373 $ hg clone ssh://user@dummy/repo clone
374 requesting all changes
374 requesting all changes
375 remote: b2x:remote-changegroup
375 remote: remote-changegroup
376 adding changesets
376 adding changesets
377 adding manifests
377 adding manifests
378 adding file changes
378 adding file changes
@@ -388,7 +388,7 b' If either of the multiple hash digests m'
388 > EOF
388 > EOF
389 $ hg clone ssh://user@dummy/repo clone
389 $ hg clone ssh://user@dummy/repo clone
390 requesting all changes
390 requesting all changes
391 remote: b2x:remote-changegroup
391 remote: remote-changegroup
392 adding changesets
392 adding changesets
393 adding manifests
393 adding manifests
394 adding file changes
394 adding file changes
@@ -404,7 +404,7 b' If either of the multiple hash digests m'
404 > EOF
404 > EOF
405 $ hg clone ssh://user@dummy/repo clone
405 $ hg clone ssh://user@dummy/repo clone
406 requesting all changes
406 requesting all changes
407 remote: b2x:remote-changegroup
407 remote: remote-changegroup
408 adding changesets
408 adding changesets
409 adding manifests
409 adding manifests
410 adding file changes
410 adding file changes
@@ -433,12 +433,12 b' Corruption tests'
433 $ hg pull -R clone ssh://user@dummy/repo
433 $ hg pull -R clone ssh://user@dummy/repo
434 pulling from ssh://user@dummy/repo
434 pulling from ssh://user@dummy/repo
435 searching for changes
435 searching for changes
436 remote: b2x:remote-changegroup
436 remote: remote-changegroup
437 adding changesets
437 adding changesets
438 adding manifests
438 adding manifests
439 adding file changes
439 adding file changes
440 added 2 changesets with 2 changes to 2 files (+1 heads)
440 added 2 changesets with 2 changes to 2 files (+1 heads)
441 remote: b2x:remote-changegroup
441 remote: remote-changegroup
442 adding changesets
442 adding changesets
443 adding manifests
443 adding manifests
444 adding file changes
444 adding file changes
@@ -467,7 +467,7 b' No params'
467 $ hg pull -R clone ssh://user@dummy/repo
467 $ hg pull -R clone ssh://user@dummy/repo
468 pulling from ssh://user@dummy/repo
468 pulling from ssh://user@dummy/repo
469 searching for changes
469 searching for changes
470 remote: b2x:remote-changegroup
470 remote: remote-changegroup
471 abort: remote-changegroup: missing "url" param
471 abort: remote-changegroup: missing "url" param
472 [255]
472 [255]
473
473
@@ -479,7 +479,7 b' Missing size'
479 $ hg pull -R clone ssh://user@dummy/repo
479 $ hg pull -R clone ssh://user@dummy/repo
480 pulling from ssh://user@dummy/repo
480 pulling from ssh://user@dummy/repo
481 searching for changes
481 searching for changes
482 remote: b2x:remote-changegroup
482 remote: remote-changegroup
483 abort: remote-changegroup: missing "size" param
483 abort: remote-changegroup: missing "size" param
484 [255]
484 [255]
485
485
@@ -491,7 +491,7 b' Invalid size'
491 $ hg pull -R clone ssh://user@dummy/repo
491 $ hg pull -R clone ssh://user@dummy/repo
492 pulling from ssh://user@dummy/repo
492 pulling from ssh://user@dummy/repo
493 searching for changes
493 searching for changes
494 remote: b2x:remote-changegroup
494 remote: remote-changegroup
495 abort: remote-changegroup: invalid value for param "size"
495 abort: remote-changegroup: invalid value for param "size"
496 [255]
496 [255]
497
497
@@ -503,7 +503,7 b' Size mismatch'
503 $ hg pull -R clone ssh://user@dummy/repo
503 $ hg pull -R clone ssh://user@dummy/repo
504 pulling from ssh://user@dummy/repo
504 pulling from ssh://user@dummy/repo
505 searching for changes
505 searching for changes
506 remote: b2x:remote-changegroup
506 remote: remote-changegroup
507 adding changesets
507 adding changesets
508 adding manifests
508 adding manifests
509 adding file changes
509 adding file changes
@@ -522,8 +522,8 b' Unknown digest'
522 $ hg pull -R clone ssh://user@dummy/repo
522 $ hg pull -R clone ssh://user@dummy/repo
523 pulling from ssh://user@dummy/repo
523 pulling from ssh://user@dummy/repo
524 searching for changes
524 searching for changes
525 remote: b2x:remote-changegroup
525 remote: remote-changegroup
526 abort: missing support for b2x:remote-changegroup - digest:foo
526 abort: missing support for remote-changegroup - digest:foo
527 [255]
527 [255]
528
528
529 Missing digest
529 Missing digest
@@ -534,7 +534,7 b' Missing digest'
534 $ hg pull -R clone ssh://user@dummy/repo
534 $ hg pull -R clone ssh://user@dummy/repo
535 pulling from ssh://user@dummy/repo
535 pulling from ssh://user@dummy/repo
536 searching for changes
536 searching for changes
537 remote: b2x:remote-changegroup
537 remote: remote-changegroup
538 abort: remote-changegroup: missing "digest:sha1" param
538 abort: remote-changegroup: missing "digest:sha1" param
539 [255]
539 [255]
540
540
@@ -546,7 +546,7 b' Not an HTTP url'
546 $ hg pull -R clone ssh://user@dummy/repo
546 $ hg pull -R clone ssh://user@dummy/repo
547 pulling from ssh://user@dummy/repo
547 pulling from ssh://user@dummy/repo
548 searching for changes
548 searching for changes
549 remote: b2x:remote-changegroup
549 remote: remote-changegroup
550 abort: remote-changegroup does not support ssh urls
550 abort: remote-changegroup does not support ssh urls
551 [255]
551 [255]
552
552
@@ -561,14 +561,14 b' Not a bundle'
561 $ hg pull -R clone ssh://user@dummy/repo
561 $ hg pull -R clone ssh://user@dummy/repo
562 pulling from ssh://user@dummy/repo
562 pulling from ssh://user@dummy/repo
563 searching for changes
563 searching for changes
564 remote: b2x:remote-changegroup
564 remote: remote-changegroup
565 abort: http://localhost:$HGPORT/notbundle.hg: not a Mercurial bundle
565 abort: http://localhost:$HGPORT/notbundle.hg: not a Mercurial bundle
566 [255]
566 [255]
567
567
568 Not a bundle 1.0
568 Not a bundle 1.0
569
569
570 $ cat > notbundle10.hg << EOF
570 $ cat > notbundle10.hg << EOF
571 > HG2Y
571 > HG20
572 > EOF
572 > EOF
573 $ cat > repo/.hg/bundle2maker << EOF
573 $ cat > repo/.hg/bundle2maker << EOF
574 > remote-changegroup http://localhost:$HGPORT/notbundle10.hg notbundle10.hg
574 > remote-changegroup http://localhost:$HGPORT/notbundle10.hg notbundle10.hg
@@ -576,7 +576,7 b' Not a bundle 1.0'
576 $ hg pull -R clone ssh://user@dummy/repo
576 $ hg pull -R clone ssh://user@dummy/repo
577 pulling from ssh://user@dummy/repo
577 pulling from ssh://user@dummy/repo
578 searching for changes
578 searching for changes
579 remote: b2x:remote-changegroup
579 remote: remote-changegroup
580 abort: http://localhost:$HGPORT/notbundle10.hg: not a bundle version 1.0
580 abort: http://localhost:$HGPORT/notbundle10.hg: not a bundle version 1.0
581 [255]
581 [255]
582
582
@@ -170,7 +170,7 b' Get branch and merge:'
170 $ hg debuggetbundle repo bundle -t bundle2
170 $ hg debuggetbundle repo bundle -t bundle2
171 $ hg debugbundle bundle
171 $ hg debugbundle bundle
172 Stream params: {}
172 Stream params: {}
173 b2x:changegroup -- "{'version': '01'}"
173 changegroup -- "{'version': '01'}"
174 7704483d56b2a7b5db54dcee7c62378ac629b348
174 7704483d56b2a7b5db54dcee7c62378ac629b348
175 29a4d1f17bd3f0779ca0525bebb1cfb51067c738
175 29a4d1f17bd3f0779ca0525bebb1cfb51067c738
176 713346a995c363120712aed1aee7e04afd867638
176 713346a995c363120712aed1aee7e04afd867638
@@ -218,7 +218,7 b''
218
218
219 $ hg debugbundle .hg/strip-backup/*
219 $ hg debugbundle .hg/strip-backup/*
220 Stream params: {}
220 Stream params: {}
221 b2x:changegroup -- "{'version': '02'}"
221 changegroup -- "{'version': '02'}"
222 264128213d290d868c54642d13aeaa3675551a78
222 264128213d290d868c54642d13aeaa3675551a78
223 $ hg incoming .hg/strip-backup/*
223 $ hg incoming .hg/strip-backup/*
224 comparing with .hg/strip-backup/264128213d29-0b39d6bf-backup.hg
224 comparing with .hg/strip-backup/264128213d29-0b39d6bf-backup.hg
@@ -244,7 +244,7 b''
244
244
245 $ hg debugbundle .hg/strip-backup/*
245 $ hg debugbundle .hg/strip-backup/*
246 Stream params: {}
246 Stream params: {}
247 b2x:changegroup -- "{'version': '02'}"
247 changegroup -- "{'version': '02'}"
248 264128213d290d868c54642d13aeaa3675551a78
248 264128213d290d868c54642d13aeaa3675551a78
249 $ hg pull .hg/strip-backup/*
249 $ hg pull .hg/strip-backup/*
250 pulling from .hg/strip-backup/264128213d29-0b39d6bf-backup.hg
250 pulling from .hg/strip-backup/264128213d29-0b39d6bf-backup.hg
General Comments 0
You need to be logged in to leave comments. Login now