~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_join.py

  • Committer: John Arbash Meinel
  • Date: 2010-02-10 17:52:08 UTC
  • mfrom: (5021 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5023.
  • Revision ID: john@arbash-meinel.com-20100210175208-bubuwav4uqigu291
Merge bzr.dev 5021 to resolve NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006, 2010 Canonical Ltd
 
1
# Copyright (C) 2006 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
17
17
 
18
18
import os
19
19
 
20
 
from bzrlib import (
21
 
    bzrdir,
22
 
    osutils,
23
 
    repository,
24
 
    tests,
25
 
    workingtree,
26
 
    )
 
20
from bzrlib import bzrdir, repository, tests, workingtree
27
21
 
28
22
 
29
23
class TestJoin(tests.TestCaseWithTransport):
56
50
    def test_join_error(self):
57
51
        base_tree, sub_tree = self.make_trees()
58
52
        os.mkdir('tree/subtree2')
59
 
        osutils.rename('tree/subtree', 'tree/subtree2/subtree')
 
53
        os.rename('tree/subtree', 'tree/subtree2/subtree')
60
54
        self.run_bzr_error(
61
55
            ('Cannot join .*subtree.  Parent directory is not versioned',),
62
56
             'join tree/subtree2/subtree')
74
68
        sub_tree.lock_read()
75
69
        self.addCleanup(sub_tree.unlock)
76
70
        self.assertEqual('file1-id', sub_tree.path2id('file1'))
77
 
        self.assertTrue(sub_tree.has_id('file1-id'))
 
71
        self.assertTrue('file1-id' in sub_tree)
78
72
        self.assertEqual('subtree-root-id', sub_tree.path2id(''))
79
73
        self.assertEqual('', sub_tree.id2path('subtree-root-id'))
80
74
        self.assertIs(None, base_tree.path2id('subtree/file1'))
81
75
        base_tree.lock_read()
82
76
        self.addCleanup(base_tree.unlock)
83
 
        self.assertFalse(base_tree.has_id('file1-id'))
 
77
        self.assertTrue('file1-id' not in base_tree)
84
78
        self.assertEqual('subtree-root-id', base_tree.path2id('subtree'))
85
79
        self.assertEqual('subtree', base_tree.id2path('subtree-root-id'))
86
80
 
95
89
                                retcode=3)
96
90
        self.assertContainsRe(err, r"Can't join trees")
97
91
        self.assertContainsRe(err, r"use bzr upgrade")
 
92
 
 
93