/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/smart/repository.py

NEWS section template into a separate file

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2010 Canonical Ltd
 
1
# Copyright (C) 2006, 2007, 2010 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
import os
21
21
import Queue
22
22
import sys
 
23
import tarfile
23
24
import tempfile
24
25
import threading
25
26
 
392
393
        if token == '':
393
394
            token = None
394
395
        try:
395
 
            token = repository.lock_write(token=token).repository_token
 
396
            token = repository.lock_write(token=token)
396
397
        except errors.LockContention, e:
397
398
            return FailedSmartServerResponse(('LockContention',))
398
399
        except errors.UnlockableTransport:
502
503
    yield pack_writer.begin()
503
504
    yield pack_writer.bytes_record(src_format.network_name(), '')
504
505
    for substream_type, substream in stream:
 
506
        if substream_type == 'inventory-deltas':
 
507
            # This doesn't feel like the ideal place to issue this warning;
 
508
            # however we don't want to do it in the Repository that's
 
509
            # generating the stream, because that might be on the server.
 
510
            # Instead we try to observe it as the stream goes by.
 
511
            ui.ui_factory.warn_cross_format_fetch(src_format,
 
512
                '(remote)')
505
513
        for record in substream:
506
514
            if record.storage_kind in ('chunked', 'fulltext'):
507
515
                serialised = record_to_fulltext_bytes(record)
675
683
            temp.close()
676
684
 
677
685
    def _tarball_of_dir(self, dirname, compression, ofile):
678
 
        import tarfile
679
686
        filename = os.path.basename(ofile.name)
680
687
        tarball = tarfile.open(fileobj=ofile, name=filename,
681
688
            mode='w|' + compression)