/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: 2017-05-21 19:09:26 UTC
  • mfrom: (6622.1.36 breezy)
  • Revision ID: jelmer@jelmer.uk-20170521190926-5vtz8xaf0e9ylrpc
Merge rename to breezy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
 
18
 
"""Test 'bzr init'"""
 
18
"""Test 'brz init'"""
19
19
 
20
20
import os
21
21
import re
22
22
 
23
 
from bzrlib import (
 
23
from breezy import (
24
24
    branch as _mod_branch,
25
25
    config as _mod_config,
26
26
    osutils,
27
27
    urlutils,
28
28
    )
29
 
from bzrlib.bzrdir import BzrDirMetaFormat1
30
 
from bzrlib.tests import TestSkipped
31
 
from bzrlib.tests import TestCaseWithTransport
32
 
from bzrlib.tests.test_sftp_transport import TestCaseWithSFTPServer
33
 
from bzrlib.workingtree import WorkingTree
 
29
from breezy.bzrdir import BzrDirMetaFormat1
 
30
from breezy.tests import TestSkipped
 
31
from breezy.tests import TestCaseWithTransport
 
32
from breezy.tests.test_sftp_transport import TestCaseWithSFTPServer
 
33
from breezy.workingtree import WorkingTree
34
34
 
35
35
 
36
36
class TestInit(TestCaseWithTransport):
40
40
        self._default_label = '2a'
41
41
 
42
42
    def test_init_with_format(self):
43
 
        # Verify bzr init --format constructs something plausible
 
43
        # Verify brz init --format constructs something plausible
44
44
        t = self.get_transport()
45
45
        self.run_bzr('init --format default')
46
46
        self.assertIsDirectory('.bzr', t)
65
65
        self.assertEqual('', err)
66
66
 
67
67
    def test_init_at_repository_root(self):
68
 
        # bzr init at the root of a repository should create a branch
 
68
        # brz init at the root of a repository should create a branch
69
69
        # and working tree even when creation of working trees is disabled.
70
70
        t = self.get_transport()
71
71
        t.mkdir('repo')
110
110
        # init an existing branch.
111
111
        out, err = self.run_bzr('init subdir2', retcode=3)
112
112
        self.assertEqual('', out)
113
 
        self.assertTrue(err.startswith('bzr: ERROR: Already a branch:'))
 
113
        self.assertTrue(err.startswith('brz: ERROR: Already a branch:'))
114
114
 
115
115
    def test_init_branch_quiet(self):
116
116
        out, err = self.run_bzr('init -q')
158
158
        return tree
159
159
 
160
160
    def test_init_create_prefix(self):
161
 
        """'bzr init --create-prefix; will create leading directories."""
 
161
        """'brz init --create-prefix; will create leading directories."""
162
162
        tree = self.create_simple_tree()
163
163
 
164
164
        self.run_bzr_error(['Parent directory of ../new/tree does not exist'],
167
167
        self.assertPathExists('new/tree/.bzr')
168
168
 
169
169
    def test_init_default_format_option(self):
170
 
        """bzr init should read default format from option default_format"""
 
170
        """brz init should read default format from option default_format"""
171
171
        g_store = _mod_config.GlobalStore()
172
172
        g_store._load_from_string('''
173
173
[DEFAULT]
178
178
        self.assertContainsRe(out, '1.9')
179
179
 
180
180
    def test_init_no_tree(self):
181
 
        """'bzr init --no-tree' creates a branch with no working tree."""
 
181
        """'brz init --no-tree' creates a branch with no working tree."""
182
182
        out, err = self.run_bzr('init --no-tree')
183
183
        self.assertStartsWith(out, 'Created a standalone branch')
184
184
 
200
200
        out, err = self.run_bzr_error(['Already a branch'],
201
201
                                      ['init', self.get_url()])
202
202
 
203
 
        # make sure using 'bzr checkout' is not suggested
 
203
        # make sure using 'brz checkout' is not suggested
204
204
        # for remote locations missing a working tree
205
 
        self.assertFalse(re.search(r'use bzr checkout', err))
 
205
        self.assertFalse(re.search(r'use brz checkout', err))
206
206
 
207
207
    def test_init_existing_branch_with_workingtree(self):
208
208
        # don't distinguish between the branch having a working tree or not
225
225
    def test_init_without_username(self):
226
226
        """Ensure init works if username is not set.
227
227
        """
228
 
        # bzr makes user specified whoami mandatory for operations
 
228
        # brz makes user specified whoami mandatory for operations
229
229
        # like commit as whoami is recorded. init however is not so final
230
230
        # and uses whoami only in a lock file. Without whoami the login name
231
231
        # is used. This test is to ensure that init passes even when whoami
232
232
        # is not available.
233
233
        self.overrideEnv('EMAIL', None)
234
 
        self.overrideEnv('BZR_EMAIL', None)
 
234
        self.overrideEnv('BRZ_EMAIL', None)
235
235
        out, err = self.run_bzr(['init', 'foo'])
236
236
        self.assertEqual(err, '')
237
237
        self.assertTrue(os.path.exists('foo'))