~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/multiparent.py

(gz) Fix test failure on alpha by correcting format string for
 gc_chk_sha1_record (Martin [gz])

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
22
21
import itertools
23
22
import os
24
23
from StringIO import StringIO
25
24
 
26
25
from bzrlib import (
27
 
    bencode,
28
26
    errors,
29
27
    patiencediff,
 
28
    trace,
30
29
    ui,
31
30
    )
 
31
from bzrlib import bencode
32
32
""")
 
33
from gzip import GzipFile
33
34
 
34
35
 
35
36
def topo_iter_keys(vf, keys=None):
421
422
                            if not (lines == self.get_line_list([revision])[0]):
422
423
                                raise AssertionError()
423
424
                            self.clear_cache()
424
 
                    pb.update(gettext('Importing revisions'),
 
425
                    pb.update('Importing revisions',
425
426
                              (total - len(revisions)) + len(added), total)
426
427
                revisions = [r for r in revisions if r not in added]
427
428
        finally:
560
561
            sio = StringIO(infile.read(count))
561
562
        finally:
562
563
            infile.close()
563
 
        zip_file = gzip.GzipFile(None, mode='rb', fileobj=sio)
 
564
        zip_file = GzipFile(None, mode='rb', fileobj=sio)
564
565
        try:
565
566
            file_version_id = zip_file.readline()
566
567
            content = zip_file.read()
576
577
                                    # before any write returns 0
577
578
            start = outfile.tell()
578
579
            try:
579
 
                zipfile = gzip.GzipFile(None, mode='ab', fileobj=outfile)
 
580
                zipfile = GzipFile(None, mode='ab', fileobj=outfile)
580
581
                zipfile.writelines(itertools.chain(
581
582
                    ['version %s\n' % version_id], diff.to_patch()))
582
583
            finally:
673
674
 
674
675
def gzip_string(lines):
675
676
    sio = StringIO()
676
 
    data_file = gzip.GzipFile(None, mode='wb', fileobj=sio)
 
677
    data_file = GzipFile(None, mode='wb', fileobj=sio)
677
678
    data_file.writelines(lines)
678
679
    data_file.close()
679
680
    return sio.getvalue()