14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
from bzrlib import errors
18
21
from bzrlib.tests import TestCaseWithTransport
32
35
self.assertRaises(errors.BzrError, wt.id2path, 'b-id')
33
36
self.assertEqual(b_wt.basedir, wt.abspath('b'))
34
37
self.assertEqual(wt.get_parent_ids(), b_wt.get_parent_ids())
39
def test_extract_in_checkout(self):
40
a_branch = self.make_branch('branch')
41
self.build_tree(['a/', 'a/b/', 'a/b/c/', 'a/b/c/d'])
42
wt = a_branch.create_checkout('a', lightweight=True)
43
wt.add(['b', 'b/c', 'b/c/d'], ['b-id', 'c-id', 'd-id'])
44
wt.commit('added files')
45
b_wt = wt.extract('b-id')
46
b_branch = branch.Branch.open('branch/b')
47
b_branch_ref = branch.Branch.open('a/b')
48
self.assertEqual(b_branch.base, b_branch_ref.base)
50
def test_extract_in_deep_checkout(self):
51
a_branch = self.make_branch('branch')
52
self.build_tree(['a/', 'a/b/', 'a/b/c/', 'a/b/c/d/', 'a/b/c/d/e'])
53
wt = a_branch.create_checkout('a', lightweight=True)
54
wt.add(['b', 'b/c', 'b/c/d', 'b/c/d/e/'], ['b-id', 'c-id', 'd-id',
56
wt.commit('added files')
57
b_wt = wt.extract('d-id')
58
b_branch = branch.Branch.open('branch/b/c/d')
59
b_branch_ref = branch.Branch.open('a/b/c/d')
60
self.assertEqual(b_branch.base, b_branch_ref.base)