~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Jelmer Vernooij
  • Date: 2012-02-20 12:19:29 UTC
  • mfrom: (6437.23.11 2.5)
  • mto: (6581.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 6582.
  • Revision ID: jelmer@samba.org-20120220121929-7ni2psvjoatm1yp4
Merge bzr/2.5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
        # support.
28
28
        self.run_bzr('init a')
29
29
        out, err = self.run_bzr('branches a')
30
 
        self.assertEquals(out, " (default)\n")
 
30
        self.assertEquals(out, "* (default)\n")
31
31
 
32
32
    def test_no_branch(self):
33
33
        # Listing the branches in a control directory without branches.
41
41
        self.run_bzr('init-repo a')
42
42
        out, err = self.run_bzr('branches', working_dir='a')
43
43
        self.assertEquals(out, "")
 
44
 
 
45
    def test_recursive_current(self):
 
46
        self.run_bzr('init .')
 
47
        self.assertEquals(".\n", self.run_bzr('branches --recursive')[0])
 
48
 
 
49
    def test_recursive(self):
 
50
        self.run_bzr('init source')
 
51
        self.run_bzr('init source/subsource')
 
52
        self.run_bzr('checkout --lightweight source checkout')
 
53
        self.run_bzr('init checkout/subcheckout')
 
54
        self.run_bzr('init checkout/.bzr/subcheckout')
 
55
        out = self.run_bzr('branches --recursive')[0]
 
56
        lines = out.split('\n')
 
57
        self.assertIs(True, 'source' in lines, lines)
 
58
        self.assertIs(True, 'source/subsource' in lines, lines)
 
59
        self.assertIs(True, 'checkout/subcheckout' in lines, lines)
 
60
        self.assertIs(True, 'checkout' not in lines, lines)
 
61
 
 
62
    def test_indicates_non_branch(self):
 
63
        t = self.make_branch_and_tree('a', format='development-colo')
 
64
        t.bzrdir.create_branch(name='another')
 
65
        t.bzrdir.create_branch(name='colocated')
 
66
        out, err = self.run_bzr('branches a')
 
67
        self.assertEquals(out, "* (default)\n"
 
68
                               "  another\n"
 
69
                               "  colocated\n")
 
70
 
 
71
    def test_indicates_branch(self):
 
72
        t = self.make_repository('a', format='development-colo')
 
73
        t.bzrdir.create_branch(name='another')
 
74
        branch = t.bzrdir.create_branch(name='colocated')
 
75
        t.bzrdir.set_branch_reference(target_branch=branch)
 
76
        out, err = self.run_bzr('branches a')
 
77
        self.assertEquals(out, "  another\n"
 
78
                               "* colocated\n")