~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

merge with get_file_sha1

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
        # --format=weave should be accepted to allow interoperation with
45
45
        # old releases when desired.
46
46
        out, err = self.run_bzr('init --format=weave')
47
 
        self.assertEqual('', out)
 
47
        self.assertEqual("""Standalone tree (format: weave)
 
48
Location:
 
49
  branch root: .
 
50
""", out)
48
51
        self.assertEqual('', err)
49
52
 
50
53
    def test_init_at_repository_root(self):
57
60
        repo = newdir.create_repository(shared=True)
58
61
        repo.set_make_working_trees(False)
59
62
        out, err = self.run_bzr('init repo')
60
 
        self.assertEqual('', out)
 
63
        self.assertEqual(
 
64
"""Repository tree (format: pack-0.92)
 
65
Location:
 
66
  shared repository: repo
 
67
  repository branch: repo
 
68
""", out)
61
69
        self.assertEqual('', err)
62
70
        newdir.open_branch()
63
71
        newdir.open_workingtree()
64
72
        
65
73
    def test_init_branch(self):
66
74
        out, err = self.run_bzr('init')
67
 
        self.assertEqual('', out)
 
75
        self.assertEqual(
 
76
"""Standalone tree (format: pack-0.92)
 
77
Location:
 
78
  branch root: .
 
79
""", out)
68
80
        self.assertEqual('', err)
69
81
 
70
82
        # Can it handle subdirectories of branches too ?
71
83
        out, err = self.run_bzr('init subdir1')
72
 
        self.assertEqual('', out)
 
84
        self.assertEqual(
 
85
"""Standalone tree (format: pack-0.92)
 
86
Location:
 
87
  branch root: subdir1
 
88
""", out)
73
89
        self.assertEqual('', err)
74
90
        WorkingTree.open('subdir1')
75
91
        
80
96
        
81
97
        os.mkdir('subdir2')
82
98
        out, err = self.run_bzr('init subdir2')
83
 
        self.assertEqual('', out)
 
99
        self.assertEqual("""Standalone tree (format: pack-0.92)
 
100
Location:
 
101
  branch root: subdir2
 
102
""", out)
84
103
        self.assertEqual('', err)
85
104
        # init an existing branch.
86
105
        out, err = self.run_bzr('init subdir2', retcode=3)
87
106
        self.assertEqual('', out)
88
107
        self.failUnless(err.startswith('bzr: ERROR: Already a branch:'))
89
108
 
 
109
    def test_init_branch_quiet(self):
 
110
        out, err = self.run_bzr('init -q')
 
111
        self.assertEqual('', out)
 
112
        self.assertEqual('', err)
 
113
 
90
114
    def test_init_existing_branch(self):
91
115
        self.run_bzr('init')
92
116
        out, err = self.run_bzr('init', retcode=3)
142
166
    def test_init(self):
143
167
        # init on a remote url should succeed.
144
168
        out, err = self.run_bzr(['init', self.get_url()])
145
 
        self.assertEqual('', out)
 
169
        self.assertStartsWith(out, """Standalone branch (format: pack-0.92)
 
170
Location:
 
171
  branch root: """)
146
172
        self.assertEqual('', err)
147
173
    
148
174
    def test_init_existing_branch(self):