/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

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

  • Committer: Jelmer Vernooij
  • Date: 2018-02-18 21:42:57 UTC
  • mto: This revision was merged to the branch mainline in revision 6859.
  • Revision ID: jelmer@jelmer.uk-20180218214257-jpevutp1wa30tz3v
Update TODO to reference Breezy, not Bazaar.

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
        """Smoke test for constructing a format 2a repository."""
52
52
        out, err = self.run_bzr('init --format=2a')
53
53
        self.assertEqual("""Created a standalone tree (format: 2a)\n""",
54
 
                         out)
55
 
        self.assertEqual('', err)
56
 
 
57
 
    def test_init_format_bzr(self):
58
 
        """Smoke test for constructing a format with the 'bzr' alias."""
59
 
        out, err = self.run_bzr('init --format=bzr')
60
 
        self.assertEqual(
61
 
            "Created a standalone tree (format: %s)\n" % self._default_label,
62
54
            out)
63
55
        self.assertEqual('', err)
64
56
 
65
57
    def test_init_colocated(self):
66
58
        """Smoke test for constructing a colocated branch."""
67
 
        out, err = self.run_bzr(
68
 
            'init --format=development-colo file:,branch=abranch')
69
 
        self.assertEqual("""Created a standalone tree (format: development-colo)\n""",
70
 
                         out)
 
59
        out, err = self.run_bzr('init --format=development-colo file:,branch=abranch')
 
60
        self.assertEqual("""Created a lightweight checkout (format: development-colo)\n""",
 
61
            out)
71
62
        self.assertEqual('', err)
72
63
        out, err = self.run_bzr('branches')
73
64
        self.assertEqual("  abranch\n", out)
107
98
        WorkingTree.open('subdir1')
108
99
 
109
100
        self.run_bzr_error(['Parent directory of subdir2/nothere does not exist'],
110
 
                           'init subdir2/nothere')
 
101
                            'init subdir2/nothere')
111
102
        out, err = self.run_bzr('init subdir2/nothere', retcode=3)
112
103
        self.assertEqual('', out)
113
104
 
162
153
    def create_simple_tree(self):
163
154
        tree = self.make_branch_and_tree('tree')
164
155
        self.build_tree(['tree/a'])
165
 
        tree.add(['a'], [b'a-id'])
166
 
        tree.commit('one', rev_id=b'r1')
 
156
        tree.add(['a'], ['a-id'])
 
157
        tree.commit('one', rev_id='r1')
167
158
        return tree
168
159
 
169
160
    def test_init_create_prefix(self):
171
162
        tree = self.create_simple_tree()
172
163
 
173
164
        self.run_bzr_error(['Parent directory of ../new/tree does not exist'],
174
 
                           'init ../new/tree', working_dir='tree')
 
165
                            'init ../new/tree', working_dir='tree')
175
166
        self.run_bzr('init ../new/tree --create-prefix', working_dir='tree')
176
167
        self.assertPathExists('new/tree/.bzr')
177
168
 
178
169
    def test_init_default_format_option(self):
179
170
        """brz init should read default format from option default_format"""
180
171
        g_store = _mod_config.GlobalStore()
181
 
        g_store._load_from_string(b'''
 
172
        g_store._load_from_string('''
182
173
[DEFAULT]
183
174
default_format = 1.9
184
175
''')
185
176
        g_store.save()
186
177
        out, err = self.run_bzr_subprocess('init')
187
 
        self.assertContainsRe(out, b'1.9')
 
178
        self.assertContainsRe(out, '1.9')
188
179
 
189
180
    def test_init_no_tree(self):
190
181
        """'brz init --no-tree' creates a branch with no working tree."""
198
189
        # init on a remote url should succeed.
199
190
        out, err = self.run_bzr(['init', '--format=pack-0.92', self.get_url()])
200
191
        self.assertEqual(out,
201
 
                         """Created a standalone branch (format: pack-0.92)\n""")
 
192
            """Created a standalone branch (format: pack-0.92)\n""")
202
193
        self.assertEqual('', err)
203
194
 
204
195
    def test_init_existing_branch(self):
225
216
        self.run_bzr('init --format=dirstate-tags normal_branch6')
226
217
        branch = _mod_branch.Branch.open('normal_branch6')
227
218
        self.assertEqual(None, branch.get_append_revisions_only())
228
 
        self.run_bzr(
229
 
            'init --append-revisions-only --format=dirstate-tags branch6')
 
219
        self.run_bzr('init --append-revisions-only --format=dirstate-tags branch6')
230
220
        branch = _mod_branch.Branch.open('branch6')
231
221
        self.assertEqual(True, branch.get_append_revisions_only())
232
222
        self.run_bzr_error(['cannot be set to append-revisions-only'],
245
235
        out, err = self.run_bzr(['init', 'foo'])
246
236
        self.assertEqual(err, '')
247
237
        self.assertTrue(os.path.exists('foo'))
 
238