~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/weaverepo.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-01-12 00:08:41 UTC
  • mfrom: (5590.1.6 2.3-gzip-py2.7)
  • Revision ID: pqm@pqm.ubuntu.com-20110112000841-bsgwos6fnhv9nlc7
(jameinel) Stop using bzrlib.tuned_gzip.GzipFile. (John A Meinel)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007-2010 Canonical Ltd
 
1
# Copyright (C) 2007-2011 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
20
20
ghosts.
21
21
"""
22
22
 
 
23
import gzip
23
24
import os
24
25
from cStringIO import StringIO
25
26
import urllib
40
41
    lockdir,
41
42
    osutils,
42
43
    trace,
 
44
    tuned_gzip,
43
45
    urlutils,
44
46
    versionedfile,
45
47
    weave,
56
58
    RepositoryFormat,
57
59
    )
58
60
from bzrlib.store.text import TextStore
59
 
from bzrlib.tuned_gzip import GzipFile, bytes_to_gzip
60
61
from bzrlib.versionedfile import (
61
62
    AbsentContentFactory,
62
63
    FulltextContentFactory,
589
590
            raise ValueError('bad idea to put / in %r' % (key,))
590
591
        text = ''.join(lines)
591
592
        if self._compressed:
592
 
            text = bytes_to_gzip(text)
 
593
            text = tuned_gzip.bytes_to_gzip(text)
593
594
        path = self._map(key)
594
595
        self._transport.put_bytes_non_atomic(path, text, create_parent_dir=True)
595
596
 
637
638
            else:
638
639
                return None
639
640
        if compressed:
640
 
            text = GzipFile(mode='rb', fileobj=StringIO(text)).read()
 
641
            text = gzip.GzipFile(mode='rb', fileobj=StringIO(text)).read()
641
642
        return text
642
643
 
643
644
    def _map(self, key):