~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/repository.py

  • Committer: Robert Collins
  • Date: 2008-09-02 05:28:37 UTC
  • mfrom: (3675 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3677.
  • Revision ID: robertc@robertcollins.net-20080902052837-ec3qlv41q5e7f6fl
Resolve conflicts with NEWS.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
import tempfile
24
24
import tarfile
25
25
 
26
 
from bzrlib import errors
 
26
from bzrlib import (
 
27
    errors,
 
28
    osutils,
 
29
    )
27
30
from bzrlib.bzrdir import BzrDir
28
31
from bzrlib.pack import ContainerSerialiser
29
32
from bzrlib.smart.request import (
357
360
            osutils.rmtree(tmp_dirname)
358
361
 
359
362
    def _copy_to_tempdir(self, from_repo):
360
 
        tmp_dirname = tempfile.mkdtemp(prefix='tmpbzrclone')
 
363
        tmp_dirname = osutils.mkdtemp(prefix='tmpbzrclone')
361
364
        tmp_bzrdir = from_repo.bzrdir._format.initialize(tmp_dirname)
362
365
        tmp_repo = from_repo._format.initialize(tmp_bzrdir)
363
366
        from_repo.copy_content_into(tmp_repo)
370
373
            # all finished; write the tempfile out to the network
371
374
            temp.seek(0)
372
375
            return SuccessfulSmartServerResponse(('ok',), temp.read())
373
 
            # FIXME: Don't read the whole thing into memory here; rather stream it
374
 
            # out from the file onto the network. mbp 20070411
 
376
            # FIXME: Don't read the whole thing into memory here; rather stream
 
377
            # it out from the file onto the network. mbp 20070411
375
378
        finally:
376
379
            temp.close()
377
380