~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Robert Collins
  • Date: 2007-04-19 02:27:44 UTC
  • mto: This revision was merged to the branch mainline in revision 2426.
  • Revision ID: robertc@robertcollins.net-20070419022744-pfdqz42kp1wizh43
``make docs`` now creates a man page at ``man1/bzr.1`` fixing bug 107388.
(Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
39
39
 
40
40
    def test_join(self):
41
41
        base_tree, sub_tree = self.make_trees()
42
 
        self.run_bzr('join tree/subtree')
 
42
        self.run_bzr('join', 'tree/subtree')
43
43
        self.check_success('tree')
44
44
 
45
45
    def test_join_dot(self):
46
46
        base_tree, sub_tree = self.make_trees()
47
 
        self.run_bzr('join .', working_dir='tree/subtree')
 
47
        self.run_bzr('join', '.', working_dir='tree/subtree')
48
48
        self.check_success('tree')
49
49
 
50
50
    def test_join_error(self):
53
53
        os.rename('tree/subtree', 'tree/subtree2/subtree')
54
54
        self.run_bzr_error(
55
55
            ('Cannot join .*subtree.  Parent directory is not versioned',),
56
 
             'join tree/subtree2/subtree')
 
56
             'join', 'tree/subtree2/subtree')
57
57
        # disabled because this gives an ugly error at present -- mbp 20070306
58
58
        ## self.run_bzr_error(
59
59
        ##     ('Cannot join .*subtree.  Parent directory is not versioned',),
60
60
        ##      'join', '--reference', 'tree/subtree2/subtree')
61
 
        self.run_bzr_error(('Not a branch:.*subtree2',),
62
 
                           'join tree/subtree2')
 
61
        self.run_bzr_error(('Not a branch:.*subtree2',), 'join',
 
62
                            'tree/subtree2')
63
63
 
64
64
    def test_join_reference(self):
65
65
        """Join can add a reference if --reference is supplied"""
66
66
        base_tree, sub_tree = self.make_trees()
67
 
        self.run_bzr('join . --reference', working_dir='tree/subtree')
 
67
        self.run_bzr('join', '.', '--reference', working_dir='tree/subtree')
68
68
        sub_tree.lock_read()
69
69
        self.addCleanup(sub_tree.unlock)
70
70
        self.assertEqual('file1-id', sub_tree.path2id('file1'))
81
81
    def test_references_check_repository_support(self):
82
82
        """Users are stopped from adding a reference that can't be committed."""
83
83
        # in 0.15 the default format has a dirstate workingtree, that can
84
 
        # support tree references, but the default repository format
 
84
        # support tree references, but the default repository format 
85
85
        # cannot.
86
86
        tree = self.make_branch_and_tree('tree', format='dirstate')
87
87
        tree2 = self.make_branch_and_tree('tree/subtree')
88
 
        out, err = self.run_bzr('join --reference tree/subtree',
89
 
                                retcode=3)
90
 
        self.assertContainsRe(err, r"Can't join trees")
91
 
        self.assertContainsRe(err, r"use bzr upgrade")
 
88
        out, err = self.run_bzr('join', '--reference', 'tree/subtree',
 
89
            retcode=3)
 
90
        self.assertContainsRe(err,
 
91
            r"Can't join trees")
 
92
        self.assertContainsRe(err,
 
93
            r"use bzr upgrade")
92
94
 
93
95