/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/tests/test_whitebox.py

  • Committer: Martin Pool
  • Date: 2006-10-06 02:04:17 UTC
  • mfrom: (1908.10.1 bench_usecases.merge2)
  • mto: This revision was merged to the branch mainline in revision 2068.
  • Revision ID: mbp@sourcefrog.net-20061006020417-4949ca86f4417a4d
merge additional fix from cfbolz

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright (C) 2005, 2006 by Canonical Ltd
 
2
#
 
3
# This program is free software; you can redistribute it and/or modify
 
4
# it under the terms of the GNU General Public License as published by
 
5
# the Free Software Foundation; either version 2 of the License, or
 
6
# (at your option) any later version.
 
7
#
 
8
# This program is distributed in the hope that it will be useful,
 
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
# GNU General Public License for more details.
 
12
#
 
13
# You should have received a copy of the GNU General Public License
 
14
# along with this program; if not, write to the Free Software
 
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
16
 
1
17
import os
2
18
import unittest
3
19
 
4
20
from bzrlib.tests import TestCaseWithTransport, TestCase
5
 
from bzrlib.branch import ScratchBranch, Branch
 
21
from bzrlib.branch import Branch
6
22
from bzrlib.errors import PathNotChild
7
23
from bzrlib.osutils import relpath, pathjoin, abspath, realpath
8
24
 
16
32
        job: given a path (either relative to cwd or absolute), work out
17
33
        if it is inside a branch and return the path relative to the base.
18
34
        """
19
 
        import tempfile, shutil
 
35
        import tempfile
 
36
        from bzrlib.osutils import rmtree
20
37
        
21
38
        savedir = os.getcwdu()
22
39
        dtmp = tempfile.mkdtemp()
64
81
 
65
82
        finally:
66
83
            os.chdir(savedir)
67
 
            shutil.rmtree(dtmp)
 
84
            rmtree(dtmp)