~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/multiparent.py

  • Committer: John Arbash Meinel
  • Date: 2011-04-07 10:36:24 UTC
  • mfrom: (5764 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5766.
  • Revision ID: john@arbash-meinel.com-20110407103624-n76g6tjeqmznwdcd
Merge bzr.dev 5764 to resolve release-notes (aka NEWS) conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
lazy_import(globals(), """
20
20
import errno
 
21
import gzip
21
22
import itertools
22
23
import os
23
24
from StringIO import StringIO
24
25
 
25
26
from bzrlib import (
 
27
    bencode,
26
28
    errors,
27
29
    patiencediff,
28
 
    trace,
29
30
    ui,
30
31
    )
31
 
from bzrlib import bencode
32
32
""")
33
 
from gzip import GzipFile
34
33
 
35
34
 
36
35
def topo_iter_keys(vf, keys=None):
561
560
            sio = StringIO(infile.read(count))
562
561
        finally:
563
562
            infile.close()
564
 
        zip_file = GzipFile(None, mode='rb', fileobj=sio)
 
563
        zip_file = gzip.GzipFile(None, mode='rb', fileobj=sio)
565
564
        try:
566
565
            file_version_id = zip_file.readline()
567
566
            content = zip_file.read()
577
576
                                    # before any write returns 0
578
577
            start = outfile.tell()
579
578
            try:
580
 
                zipfile = GzipFile(None, mode='ab', fileobj=outfile)
 
579
                zipfile = gzip.GzipFile(None, mode='ab', fileobj=outfile)
581
580
                zipfile.writelines(itertools.chain(
582
581
                    ['version %s\n' % version_id], diff.to_patch()))
583
582
            finally:
674
673
 
675
674
def gzip_string(lines):
676
675
    sio = StringIO()
677
 
    data_file = GzipFile(None, mode='wb', fileobj=sio)
 
676
    data_file = gzip.GzipFile(None, mode='wb', fileobj=sio)
678
677
    data_file.writelines(lines)
679
678
    data_file.close()
680
679
    return sio.getvalue()