source: packages/net/mercurial/patches/001-no_bzip2.patch

Last change on this file was 27120, checked in by swalker, 5 years ago

[packages] mercurial: update to 1.8.4, refresh patches

File size: 6.7 KB
  • mercurial/archival.py

    a b def tidyprefix(dest, kind, prefix): 
    3737 
    3838exts = { 
    3939    'tar': ['.tar'], 
    40     'tbz2': ['.tbz2', '.tar.bz2'], 
    4140    'tgz': ['.tgz', '.tar.gz'], 
    4241    'zip': ['.zip'], 
    4342    } 
    def guesskind(dest): 
    5150 
    5251class tarit(object): 
    5352    '''write archive to tar file or stream.  can write uncompressed, 
    54     or compress with gzip or bzip2.''' 
     53    or compress with gzip.''' 
    5554 
    5655    class GzipFileWithTime(gzip.GzipFile): 
    5756 
    class fileit(object): 
    205204archivers = { 
    206205    'files': fileit, 
    207206    'tar': tarit, 
    208     'tbz2': lambda name, mtime: tarit(name, mtime, 'bz2'), 
    209207    'tgz': lambda name, mtime: tarit(name, mtime, 'gz'), 
    210208    'uzip': lambda name, mtime: zipit(name, mtime, False), 
    211209    'zip': zipit, 
  • mercurial/bundlerepo.py

    a b def getremotechanges(ui, repo, other, re 
    307307            cg = other.changegroup(incoming, "incoming") 
    308308        else: 
    309309            cg = other.changegroupsubset(incoming, revs, 'incoming') 
    310         bundletype = other.local() and "HG10BZ" or "HG10UN" 
     310        bundletype = other.local() and "HG10GZ" or "HG10UN" 
    311311        fname = bundle = changegroup.writebundle(cg, bundlename, bundletype) 
    312312        # keep written bundle? 
    313313        if bundlename: 
  • mercurial/changegroup.py

    a b  
    77 
    88from i18n import _ 
    99import util 
    10 import struct, os, bz2, zlib, tempfile 
     10import struct, os, zlib, tempfile 
    1111 
    1212def readexactly(stream, n): 
    1313    '''read n bytes from stream.read and abort if less was available''' 
    class nocompress(object): 
    4545bundletypes = { 
    4646    "": ("", nocompress), 
    4747    "HG10UN": ("HG10UN", nocompress), 
    48     "HG10BZ": ("HG10", lambda: bz2.BZ2Compressor()), 
    4948    "HG10GZ": ("HG10GZ", lambda: zlib.compressobj()), 
    5049} 
    5150 
    def collector(cl, mmfs, files): 
    5958    return collect 
    6059 
    6160# hgweb uses this list to communicate its preferred type 
    62 bundlepriority = ['HG10GZ', 'HG10BZ', 'HG10UN'] 
     61bundlepriority = ['HG10GZ', 'HG10UN'] 
    6362 
    6463def writebundle(cg, filename, bundletype): 
    6564    """Write a bundle file and return its filename. 
    6665 
    6766    Existing files will not be overwritten. 
    6867    If no filename is specified, a temporary file is created. 
    69     bz2 compression can be turned off. 
    7068    The bundle file will be deleted in case of errors. 
    7169    """ 
    7270 
    def decompressor(fh, alg): 
    124122            zd = zlib.decompressobj() 
    125123            for chunk in f: 
    126124                yield zd.decompress(chunk) 
    127     elif alg == 'BZ': 
    128         def generator(f): 
    129             zd = bz2.BZ2Decompressor() 
    130             zd.decompress("BZ") 
    131             for chunk in util.filechunkiter(f, 4096): 
    132                 yield zd.decompress(chunk) 
    133125    else: 
    134126        raise util.Abort("unknown bundle compression '%s'" % alg) 
    135127    return util.chunkbuffer(generator(fh)) 
  • mercurial/hgweb/hgwebdir_mod.py

    a b class hgwebdir(object): 
    204204        def archivelist(ui, nodeid, url): 
    205205            allowed = ui.configlist("web", "allow_archive", untrusted=True) 
    206206            archives = [] 
    207             for i in [('zip', '.zip'), ('gz', '.tar.gz'), ('bz2', '.tar.bz2')]: 
     207            for i in [('zip', '.zip'), ('gz', '.tar.gz')]: 
    208208                if i[0] in allowed or ui.configbool("web", "allow" + i[0], 
    209209                                                    untrusted=True): 
    210210                    archives.append({"type" : i[0], "extension": i[1], 
  • mercurial/hgweb/hgweb_mod.py

    a b class hgweb(object): 
    4040        self.mtime = -1 
    4141        self.size = -1 
    4242        self.reponame = name 
    43         self.archives = 'zip', 'gz', 'bz2' 
     43        self.archives = 'zip', 'gz' 
    4444        self.stripecount = 1 
    4545        # a repo owner may set web.templates in .hg/hgrc to get any file 
    4646        # readable by the user running the CGI script 
    class hgweb(object): 
    284284                yield {"type" : i, "extension" : spec[2], "node" : nodeid} 
    285285 
    286286    archive_specs = { 
    287         'bz2': ('application/x-bzip2', 'tbz2', '.tar.bz2', None), 
    288287        'gz': ('application/x-gzip', 'tgz', '.tar.gz', None), 
    289288        'zip': ('application/zip', 'zip', '.zip', None), 
    290289        } 
  • mercurial/repair.py

    a b def _bundle(repo, bases, heads, node, su 
    1919        os.mkdir(backupdir) 
    2020    name = os.path.join(backupdir, "%s-%s.hg" % (short(node), suffix)) 
    2121    if compress: 
    22         bundletype = "HG10BZ" 
     22        bundletype = "HG10GZ" 
    2323    else: 
    2424        bundletype = "HG10UN" 
    2525    return changegroup.writebundle(cg, name, bundletype) 
  • mercurial/commands.py

    a b def archive(ui, repo, dest, **opts): 
    162162 
    163163    :``files``: a directory full of files (default) 
    164164    :``tar``:   tar archive, uncompressed 
    165     :``tbz2``:  tar archive, compressed using bzip2 
    166165    :``tgz``:   tar archive, compressed using gzip 
    167166    :``uzip``:  zip archive, uncompressed 
    168167    :``zip``:   zip archive, compressed using deflate 
    def bundle(ui, repo, fname, dest=None, * 
    644643    -a/--all (or --base null). 
    645644 
    646645    You can change compression method with the -t/--type option. 
    647     The available compression methods are: none, bzip2, and 
    648     gzip (by default, bundles are compressed using bzip2). 
     646    The available compression methods are: none, and 
     647    gzip (by default, bundles are compressed using gzip). 
    649648 
    650649    The bundle file can then be transferred using conventional means 
    651650    and applied to another repository with the unbundle or pull 
    def bundle(ui, repo, fname, dest=None, * 
    712711    else: 
    713712        cg = repo.changegroup(o, 'bundle') 
    714713 
    715     bundletype = opts.get('type', 'bzip2').lower() 
    716     btypes = {'none': 'HG10UN', 'bzip2': 'HG10BZ', 'gzip': 'HG10GZ'} 
     714    bundletype = opts.get('type', 'gzip').lower() 
     715    btypes = {'none': 'HG10UN', 'gzip': 'HG10GZ'} 
    717716    bundletype = btypes.get(bundletype) 
    718717    if bundletype not in changegroup.bundletypes: 
    719718        raise util.Abort(_('unknown bundle type specified with --type')) 
    table = { 
    43164315           _('a base changeset assumed to be available at the destination'), 
    43174316           _('REV')), 
    43184317          ('a', 'all', None, _('bundle all changesets in the repository')), 
    4319           ('t', 'type', 'bzip2', 
     4318          ('t', 'type', 'gzip', 
    43204319           _('bundle compression type to use'), _('TYPE')), 
    43214320         ] + remoteopts, 
    43224321         _('[-f] [-t TYPE] [-a] [-r REV]... [--base REV]... FILE [DEST]')), 
  • setup.py

    a b except: 
    3636    raise SystemExit( 
    3737        "Couldn't import standard zlib (incomplete Python install).") 
    3838 
    39 try: 
    40     import bz2 
    41 except: 
    42     raise SystemExit( 
    43         "Couldn't import standard bz2 (incomplete Python install).") 
    44  
    4539import os, subprocess, time 
    4640import shutil 
    4741import tempfile 
Note: See TracBrowser for help on using the repository browser.