~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-05-06 11:40:10 UTC
  • mfrom: (3400.1.3 trivial)
  • Revision ID: pqm@pqm.ubuntu.com-20080506114010-jwclr2qtiekvawjg
Remove erroneous creation of branch-name file in cmd_branch

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
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
17
 
18
18
import os
19
19
 
20
 
from bzrlib import (
21
 
    osutils,
22
 
    tests,
23
 
    workingtree,
24
 
    )
 
20
from bzrlib import bzrdir, repository, tests, workingtree
25
21
 
26
22
 
27
23
class TestJoin(tests.TestCaseWithTransport):
28
24
 
29
25
    def make_trees(self):
30
26
        base_tree = self.make_branch_and_tree('tree',
31
 
            format='development-subtree')
 
27
            format='dirstate-with-subtree')
32
28
        base_tree.commit('empty commit')
33
29
        self.build_tree(['tree/subtree/', 'tree/subtree/file1'])
34
30
        sub_tree = self.make_branch_and_tree('tree/subtree')
54
50
    def test_join_error(self):
55
51
        base_tree, sub_tree = self.make_trees()
56
52
        os.mkdir('tree/subtree2')
57
 
        osutils.rename('tree/subtree', 'tree/subtree2/subtree')
 
53
        os.rename('tree/subtree', 'tree/subtree2/subtree')
58
54
        self.run_bzr_error(
59
55
            ('Cannot join .*subtree.  Parent directory is not versioned',),
60
56
             'join tree/subtree2/subtree')
72
68
        sub_tree.lock_read()
73
69
        self.addCleanup(sub_tree.unlock)
74
70
        self.assertEqual('file1-id', sub_tree.path2id('file1'))
75
 
        self.assertTrue(sub_tree.has_id('file1-id'))
 
71
        self.assertTrue('file1-id' in sub_tree)
76
72
        self.assertEqual('subtree-root-id', sub_tree.path2id(''))
77
73
        self.assertEqual('', sub_tree.id2path('subtree-root-id'))
78
74
        self.assertIs(None, base_tree.path2id('subtree/file1'))
79
75
        base_tree.lock_read()
80
76
        self.addCleanup(base_tree.unlock)
81
 
        self.assertFalse(base_tree.has_id('file1-id'))
 
77
        self.assertTrue('file1-id' not in base_tree)
82
78
        self.assertEqual('subtree-root-id', base_tree.path2id('subtree'))
83
79
        self.assertEqual('subtree', base_tree.id2path('subtree-root-id'))
84
80
 
85
81
    def test_references_check_repository_support(self):
86
82
        """Users are stopped from adding a reference that can't be committed."""
87
83
        # in 0.15 the default format has a dirstate workingtree, that can
88
 
        # support tree references, but the default repository format
 
84
        # support tree references, but the default repository format 
89
85
        # cannot.
90
86
        tree = self.make_branch_and_tree('tree', format='dirstate')
91
87
        tree2 = self.make_branch_and_tree('tree/subtree')
93
89
                                retcode=3)
94
90
        self.assertContainsRe(err, r"Can't join trees")
95
91
        self.assertContainsRe(err, r"use bzr upgrade")
 
92
 
 
93