/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/weaverepo.py

  • Committer: John Arbash Meinel
  • Date: 2011-01-12 01:01:53 UTC
  • mfrom: (5597 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5599.
  • Revision ID: john@arbash-meinel.com-20110112010153-op19823r9e6hy7u6
Merge bzr.dev 5597 to resolve NEWS, aka bzr-2.3.txt

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):
743
744
 
744
745
class InterWeaveRepo(InterSameDataRepository):
745
746
    """Optimised code paths between Weave based repositories.
746
 
 
747
 
    This should be in bzrlib/repofmt/weaverepo.py but we have not yet
748
 
    implemented lazy inter-object optimisation.
749
747
    """
750
748
 
751
749
    @classmethod