comparison mercurial/changegroup.py @ 24686:e0e28e910fa3

bundle2: rename format, parts and config to final names It is finally time to freeze the bundle2 format! To do so we: - rename HG2Y to HG20, - drop "b2x:" prefix from all part names, - rename capability to "bundle2-exp" to "bundle2" - rename the hook flag from 'bundle2-exp' to 'bundle2'
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 09 Apr 2015 16:25:48 -0400
parents 903c7e8c97ad
children 90f2b9de30f2
comparison
equal deleted inserted replaced
24685:b3d78d82d84c 24686:e0e28e910fa3
69 69
70 bundletypes = { 70 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()),
78 } 78 }
79 79
100 else: 100 else:
101 fd, filename = tempfile.mkstemp(prefix="hg-bundle-", suffix=".hg") 101 fd, filename = tempfile.mkstemp(prefix="hg-bundle-", suffix=".hg")
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()
112 else: 112 else:
113 if cg.version != '01': 113 if cg.version != '01':