1 diff -urN mercurial-1.1.2/mercurial/archival.py mercurial-1.1.2-nobz2/mercurial/archival.py
2 --- mercurial-1.1.2/mercurial/archival.py 2009-01-01 00:38:33.000000000 +0100
3 +++ mercurial-1.1.2-nobz2/mercurial/archival.py 2009-01-01 13:53:14.000000000 +0100
5 self.fileobj.write(fname + '\000')
7 def __init__(self, dest, prefix, mtime, kind=''):
8 - self.prefix = tidyprefix(dest, prefix, ['.tar', '.tar.bz2', '.tar.gz',
10 + self.prefix = tidyprefix(dest, prefix, ['.tar', '.tar.gz',
14 def taropen(name, mode, fileobj=None):
19 - 'tbz2': lambda name, prefix, mtime: tarit(name, prefix, mtime, 'bz2'),
20 'tgz': lambda name, prefix, mtime: tarit(name, prefix, mtime, 'gz'),
21 'uzip': lambda name, prefix, mtime: zipit(name, prefix, mtime, False),
23 diff -urN mercurial-1.1.2/mercurial/bundlerepo.py mercurial-1.1.2-nobz2/mercurial/bundlerepo.py
24 --- mercurial-1.1.2/mercurial/bundlerepo.py 2009-01-01 00:38:33.000000000 +0100
25 +++ mercurial-1.1.2-nobz2/mercurial/bundlerepo.py 2009-01-01 13:53:59.000000000 +0100
28 from node import hex, nullid, short
30 -import changegroup, util, os, struct, bz2, zlib, tempfile, shutil, mdiff
31 +import changegroup, util, os, struct, zlib, tempfile, shutil, mdiff
32 import repo, localrepo, changelog, manifest, filelog, revlog, context
34 class bundlerevlog(revlog.revlog):
36 raise util.Abort(_("%s: not a Mercurial bundle file") % bundlename)
37 elif not header.startswith("HG10"):
38 raise util.Abort(_("%s: unknown bundle version") % bundlename)
39 - elif (header == "HG10BZ") or (header == "HG10GZ"):
40 + elif (header == "HG10GZ"):
41 fdtemp, temp = tempfile.mkstemp(prefix="hg-bundle-",
42 suffix=".hg10un", dir=self.path)
44 fptemp = os.fdopen(fdtemp, 'wb')
46 - if header == "HG10BZ":
47 - zd = bz2.BZ2Decompressor()
49 - elif header == "HG10GZ":
50 + if header == "HG10GZ":
51 zd = zlib.decompressobj()
53 yield zd.decompress(chunk)
54 diff -urN mercurial-1.1.2/mercurial/changegroup.py mercurial-1.1.2-nobz2/mercurial/changegroup.py
55 --- mercurial-1.1.2/mercurial/changegroup.py 2009-01-01 00:38:33.000000000 +0100
56 +++ mercurial-1.1.2-nobz2/mercurial/changegroup.py 2009-01-01 13:52:05.000000000 +0100
61 -import struct, os, bz2, zlib, util, tempfile
62 +import struct, os, zlib, util, tempfile
65 """get a chunk from a changegroup"""
69 "HG10UN": ("HG10UN", nocompress),
70 - "HG10BZ": ("HG10", lambda: bz2.BZ2Compressor()),
71 "HG10GZ": ("HG10GZ", lambda: zlib.compressobj()),
74 # hgweb uses this list to communicate it's preferred type
75 -bundlepriority = ['HG10GZ', 'HG10BZ', 'HG10UN']
76 +bundlepriority = ['HG10GZ', 'HG10UN']
78 def writebundle(cg, filename, bundletype):
79 """Write a bundle file and return its filename.
81 zd = zlib.decompressobj()
83 yield zd.decompress(chunk)
84 - elif header == 'HG10BZ':
86 - zd = bz2.BZ2Decompressor()
88 - for chunk in util.filechunkiter(f, 4096):
89 - yield zd.decompress(chunk)
90 return util.chunkbuffer(generator(fh))
92 def readbundle(fh, fname):
93 diff -urN mercurial-1.1.2/mercurial/hgweb/hgwebdir_mod.py mercurial-1.1.2-nobz2/mercurial/hgweb/hgwebdir_mod.py
94 --- mercurial-1.1.2/mercurial/hgweb/hgwebdir_mod.py 2009-01-01 00:38:33.000000000 +0100
95 +++ mercurial-1.1.2-nobz2/mercurial/hgweb/hgwebdir_mod.py 2009-01-01 13:54:29.000000000 +0100
98 def archivelist(ui, nodeid, url):
99 allowed = ui.configlist("web", "allow_archive", untrusted=True)
100 - for i in [('zip', '.zip'), ('gz', '.tar.gz'), ('bz2', '.tar.bz2')]:
101 + for i in [('zip', '.zip'), ('gz', '.tar.gz')]:
102 if i[0] in allowed or ui.configbool("web", "allow" + i[0],
104 yield {"type" : i[0], "extension": i[1],
105 diff -urN mercurial-1.1.2/mercurial/hgweb/hgweb_mod.py mercurial-1.1.2-nobz2/mercurial/hgweb/hgweb_mod.py
106 --- mercurial-1.1.2/mercurial/hgweb/hgweb_mod.py 2009-01-01 00:38:33.000000000 +0100
107 +++ mercurial-1.1.2-nobz2/mercurial/hgweb/hgweb_mod.py 2009-01-01 13:55:08.000000000 +0100
112 - self.archives = 'zip', 'gz', 'bz2'
113 + self.archives = 'zip', 'gz'
115 # a repo owner may set web.templates in .hg/hgrc to get any file
116 # readable by the user running the CGI script
118 yield {"type" : i, "extension" : spec[2], "node" : nodeid}
121 - 'bz2': ('application/x-tar', 'tbz2', '.tar.bz2', None),
122 'gz': ('application/x-tar', 'tgz', '.tar.gz', None),
123 'zip': ('application/zip', 'zip', '.zip', None),