~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/smart/repository.py

  • Committer: Vincent Ladeuil
  • Date: 2008-08-26 08:25:27 UTC
  • mto: (3668.1.1 trunk) (3703.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 3669.
  • Revision ID: v.ladeuil+lp@free.fr-20080826082527-109yyxzc0u24oeel
Fix all calls to tempfile.mkdtemp to osutils.mkdtemp.

* bzrlib/transform.py:
(TransformPreview.__init__): Use osutils.mkdtemp instead of
tempfile.mkdtemp.

* bzrlib/tests/test_whitebox.py:
(MoreTests.test_relpath): Use osutils.mkdtemp instead of
tempfile.mkdtemp.

* bzrlib/tests/test_setup.py:
(TestSetup.test_build_and_install): Use osutils.mkdtemp instead of
tempfile.mkdtemp.

* bzrlib/tests/test_bundle.py:
(BundleTester.get_checkout): Use osutils.mkdtemp instead of
tempfile.mkdtemp.

* bzrlib/tests/blackbox/test_outside_wt.py:
(TestOutsideWT.test_cwd_log,
TestOutsideWT.test_diff_outside_tree): Use osutils.mkdtemp instead
of tempfile.mkdtemp.

* bzrlib/smart/repository.py:
(SmartServerRepositoryTarball._copy_to_tempdir): Use
osutils.mkdtemp instead of tempfile.mkdtemp.
(SmartServerRepositoryTarball._tarfile_response): Line too long.

* bzrlib/remote.py:
(RemoteRepository._copy_repository_tarball): Use osutils.mkdtemp
instead of tempfile.mkdtemp.

* bzrlib/osutils.py:
(_mac_mkdtemp): Add docstring.

* bzrlib/mail_client.py:
(ExternalMailClient.compose): Use osutils.mkdtemp instead of
tempfile.mkdtemp.

* bzrlib/diff.py:
(DiffFromTool.__init__): Use osutils.mkdtemp instead of
tempfile.mkdtemp.

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