1 diff -urN mercurial-1.6.2/mercurial/archival.py mercurial-1.6.2-nobz2/mercurial/archival.py
2 --- mercurial-1.6.2/mercurial/archival.py 2009-01-01 00:38:33.000000000 +0100
3 +++ mercurial-1.6.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.6.2/mercurial/bundlerepo.py mercurial-1.6.2-nobz2/mercurial/bundlerepo.py
24 --- mercurial-1.6.2/mercurial/bundlerepo.py 2009-01-01 00:38:33.000000000 +0100
25 +++ mercurial-1.6.2-nobz2/mercurial/bundlerepo.py 2009-01-01 13:53:59.000000000 +0100
28 from node import nullid
30 -import os, struct, bz2, zlib, tempfile, shutil
31 +import os, struct, zlib, tempfile, shutil
32 import changegroup, util, mdiff
33 import localrepo, changelog, manifest, filelog, revlog, error
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.6.2/mercurial/changegroup.py mercurial-1.6.2-nobz2/mercurial/changegroup.py
55 --- mercurial-1.6.2/mercurial/changegroup.py 2009-01-01 00:38:33.000000000 +0100
56 +++ mercurial-1.6.2-nobz2/mercurial/changegroup.py 2009-01-01 13:52:05.000000000 +0100
60 -import struct, os, bz2, zlib, tempfile
61 +import struct, os, zlib, tempfile
67 "HG10UN": ("HG10UN", nocompress),
68 - "HG10BZ": ("HG10", lambda: bz2.BZ2Compressor()),
69 "HG10GZ": ("HG10GZ", lambda: zlib.compressobj()),
73 # hgweb uses this list to communicate its preferred type
74 -bundlepriority = ['HG10GZ', 'HG10BZ', 'HG10UN']
75 +bundlepriority = ['HG10GZ', 'HG10UN']
77 def writebundle(cg, filename, bundletype):
79 zd = zlib.decompressobj()
81 yield zd.decompress(chunk)
82 - elif header == 'HG10BZ':
84 - zd = bz2.BZ2Decompressor()
86 - for chunk in util.filechunkiter(f, 4096):
87 - yield zd.decompress(chunk)
88 return util.chunkbuffer(generator(fh))
90 def readbundle(fh, fname):
91 diff -urN mercurial-1.6.2/mercurial/hgweb/hgwebdir_mod.py mercurial-1.6.2-nobz2/mercurial/hgweb/hgwebdir_mod.py
92 --- mercurial-1.6.2/mercurial/hgweb/hgwebdir_mod.py 2009-01-01 00:38:33.000000000 +0100
93 +++ mercurial-1.6.2-nobz2/mercurial/hgweb/hgwebdir_mod.py 2009-01-01 13:54:29.000000000 +0100
96 def archivelist(ui, nodeid, url):
97 allowed = ui.configlist("web", "allow_archive", untrusted=True)
98 - for i in [('zip', '.zip'), ('gz', '.tar.gz'), ('bz2', '.tar.bz2')]:
99 + for i in [('zip', '.zip'), ('gz', '.tar.gz')]:
100 if i[0] in allowed or ui.configbool("web", "allow" + i[0],
102 yield {"type" : i[0], "extension": i[1],
103 diff -urN mercurial-1.6.2/mercurial/hgweb/hgweb_mod.py mercurial-1.6.2-nobz2/mercurial/hgweb/hgweb_mod.py
104 --- mercurial-1.6.2/mercurial/hgweb/hgweb_mod.py 2009-01-01 00:38:33.000000000 +0100
105 +++ mercurial-1.6.2-nobz2/mercurial/hgweb/hgweb_mod.py 2009-01-01 13:55:08.000000000 +0100
110 - self.archives = 'zip', 'gz', 'bz2'
111 + self.archives = 'zip', 'gz'
113 # a repo owner may set web.templates in .hg/hgrc to get any file
114 # readable by the user running the CGI script
116 yield {"type" : i, "extension" : spec[2], "node" : nodeid}
119 - 'bz2': ('application/x-tar', 'tbz2', '.tar.bz2', None),
120 'gz': ('application/x-tar', 'tgz', '.tar.gz', None),
121 'zip': ('application/zip', 'zip', '.zip', None),
123 diff -urN mercurial-1.6.2/mercurial/repair.py mercurial-1.6.2-nobz2/mercurial/repair.py
124 --- mercurial-1.6.2/mercurial/repair.py 2009-01-01 00:38:33.000000000 +0100
125 +++ mercurial-1.6.2-nobz2/mercurial/repair.py 2009-01-01 13:55:08.000000000 +0100
127 name = os.path.join(backupdir, "%s-%s.hg" % (short(node), suffix))
128 - return changegroup.writebundle(cg, name, "HG10BZ")
129 + return changegroup.writebundle(cg, name, "HG10GZ")
131 def _collectfiles(repo, striprev):
132 diff -urN mercurial-1.6.2/mercurial/commands.py mercurial-1.6.2-nobz2/mercurial/commands.py
133 --- mercurial-1.6.2/mercurial/commands.py 2009-01-01 00:38:33.000000000 +0100
134 +++ mercurial-1.6.2-nobz2/mercurial/commands.py 2009-01-01 13:55:08.000000000 +0100
139 - 'tbz2': ['.tbz2', '.tar.bz2'],
140 'tgz': ['.tgz', '.tar.gz'],
145 cg = repo.changegroup(o, 'bundle')
147 - bundletype = opts.get('type', 'bzip2').lower()
148 - btypes = {'none': 'HG10UN', 'bzip2': 'HG10BZ', 'gzip': 'HG10GZ'}
149 + bundletype = opts.get('type', 'gzip').lower()
150 + btypes = {'none': 'HG10UN', 'gzip': 'HG10GZ'}
151 bundletype = btypes.get(bundletype)
152 if bundletype not in changegroup.bundletypes:
153 raise util.Abort(_('unknown bundle type specified with --type'))
154 @@ -2365,7 +2364,7 @@
155 cg = other.changegroup(incoming, "incoming")
157 cg = other.changegroupsubset(incoming, revs, 'incoming')
158 - bundletype = other.local() and "HG10BZ" or "HG10UN"
159 + bundletype = other.local() and "HG10GZ" or "HG10UN"
160 fname = cleanup = changegroup.writebundle(cg, fname, bundletype)
161 # keep written bundle?
163 @@ -4043,7 +4042,7 @@
164 _('a base changeset assumed to be available at the destination'),
166 ('a', 'all', None, _('bundle all changesets in the repository')),
167 - ('t', 'type', 'bzip2',
168 + ('t', 'type', 'gzip',
169 _('bundle compression type to use'), _('TYPE')),
171 _('[-f] [-t TYPE] [-a] [-r REV]... [--base REV]... FILE [DEST]')),
172 diff -urN mercurial-1.6.2/setup.py mercurial-1.6.2-nobz2/setup.py
173 --- mercurial-1.6.2/setup.py 2009-01-01 00:38:33.000000000 +0100
174 +++ mercurial-1.6.2-nobz2/setup.py 2009-01-01 13:55:08.000000000 +0100
176 "Couldn't import standard zlib (incomplete Python install).")
182 - "Couldn't import standard bz2 (incomplete Python install).")
184 import os, subprocess, time