/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_shared_repository.py

  • Committer: Jelmer Vernooij
  • Date: 2019-09-01 15:33:59 UTC
  • mto: This revision was merged to the branch mainline in revision 7404.
  • Revision ID: jelmer@jelmer.uk-20190901153359-9gl0ai0x5wuiv444
Rename init-repo to init-shared-repo.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
class TestSharedRepo(TestCaseInTempDir):
29
29
 
30
30
    def test_make_repository(self):
31
 
        out, err = self.run_bzr("init-repository a")
 
31
        out, err = self.run_bzr("init-shared-repository a")
32
32
        self.assertEqual(out,
33
33
                         """Shared repository with trees (format: 2a)
34
34
Location:
41
41
        self.assertRaises(errors.NoWorkingTree, dir.open_workingtree)
42
42
 
43
43
    def test_make_repository_quiet(self):
44
 
        out, err = self.run_bzr("init-repository a -q")
 
44
        out, err = self.run_bzr("init-shared-repository a -q")
45
45
        self.assertEqual(out, "")
46
46
        self.assertEqual(err, "")
47
47
        dir = ControlDir.open('a')
54
54
 
55
55
        (Malone #38331)
56
56
        """
57
 
        out, err = self.run_bzr("init-repository .")
 
57
        out, err = self.run_bzr("init-shared-repository .")
58
58
        dir = ControlDir.open('.')
59
59
        self.assertTrue(dir.open_repository())
60
60
 
61
61
    def test_init(self):
62
 
        self.run_bzr("init-repo a")
 
62
        self.run_bzr("init-shared-repo a")
63
63
        self.run_bzr("init --format=default a/b")
64
64
        dir = ControlDir.open('a')
65
65
        self.assertIs(dir.open_repository().is_shared(), True)
71
71
        wt = bdir.open_workingtree()
72
72
 
73
73
    def test_branch(self):
74
 
        self.run_bzr("init-repo a")
 
74
        self.run_bzr("init-shared-repo a")
75
75
        self.run_bzr("init --format=default a/b")
76
76
        self.run_bzr('branch a/b a/c')
77
77
        cdir = ControlDir.open('a/c')
80
80
        cdir.open_workingtree()
81
81
 
82
82
    def test_branch_tree(self):
83
 
        self.run_bzr("init-repo --trees a")
 
83
        self.run_bzr("init-shared-repo --trees a")
84
84
        self.run_bzr("init --format=default b")
85
85
        with open('b/hello', 'wt') as f:
86
86
            f.write('bar')
96
96
 
97
97
    def test_trees_default(self):
98
98
        # 0.15 switched to trees by default
99
 
        self.run_bzr("init-repo repo")
 
99
        self.run_bzr("init-shared-repo repo")
100
100
        repo = ControlDir.open("repo").open_repository()
101
101
        self.assertEqual(True, repo.make_working_trees())
102
102
 
103
103
    def test_trees_argument(self):
104
104
        # Supplying the --trees argument should be harmless,
105
105
        # as it was previously non-default we need to get it right.
106
 
        self.run_bzr("init-repo --trees trees")
 
106
        self.run_bzr("init-shared-repo --trees trees")
107
107
        repo = ControlDir.open("trees").open_repository()
108
108
        self.assertEqual(True, repo.make_working_trees())
109
109
 
110
110
    def test_no_trees_argument(self):
111
111
        # --no-trees should make it so that there is no working tree
112
 
        self.run_bzr("init-repo --no-trees notrees")
 
112
        self.run_bzr("init-shared-repo --no-trees notrees")
113
113
        repo = ControlDir.open("notrees").open_repository()
114
114
        self.assertEqual(False, repo.make_working_trees())
115
115
 
116
116
    def test_init_repo_smart_acceptance(self):
117
 
        # The amount of hpss calls made on init-repo to a smart server should
118
 
        # be fixed.
 
117
        # The amount of hpss calls made on init-shared-repo to a smart server
 
118
        # should be fixed.
119
119
        self.setup_smart_server_with_call_log()
120
 
        self.run_bzr(['init-repo', self.get_url('repo')])
 
120
        self.run_bzr(['init-shared-repo', self.get_url('repo')])
121
121
        # This figure represent the amount of work to perform this use case. It
122
122
        # is entirely ok to reduce this number if a test fails due to rpc_count
123
123
        # being too low. If rpc_count increases, more network roundtrips have
128
128
        self.assertThat(self.hpss_calls, ContainsNoVfsCalls)
129
129
 
130
130
    def test_notification_on_branch_from_repository(self):
131
 
        out, err = self.run_bzr("init-repository -q a")
 
131
        out, err = self.run_bzr("init-shared-repository -q a")
132
132
        self.assertEqual(out, "")
133
133
        self.assertEqual(err, "")
134
134
        dir = ControlDir.open('a')
150
150
        ControlDir.hooks.install_named_hook(
151
151
            'post_repo_init', calls.append, None)
152
152
        self.assertLength(0, calls)
153
 
        self.run_bzr("init-repository a")
 
153
        self.run_bzr("init-shared-repository a")
154
154
        self.assertLength(1, calls)
155
155
 
156
156
    def test_init_repo_without_username(self):
157
 
        """Ensure init-repo works if username is not set.
 
157
        """Ensure init-shared-repo works if username is not set.
158
158
        """
159
159
        # brz makes user specified whoami mandatory for operations
160
 
        # like commit as whoami is recorded. init-repo however is not so final
161
 
        # and uses whoami only in a lock file. Without whoami the login name
162
 
        # is used. This test is to ensure that init-repo passes even when whoami
163
 
        # is not available.
 
160
        # like commit as whoami is recorded. init-shared-repo however is not so
 
161
        # final and uses whoami only in a lock file. Without whoami the login name
 
162
        # is used. This test is to ensure that init-shared-repo passes even
 
163
        # when whoami is not available.
164
164
        self.overrideEnv('EMAIL', None)
165
165
        self.overrideEnv('BRZ_EMAIL', None)
166
 
        out, err = self.run_bzr(['init-repo', 'foo'])
 
166
        out, err = self.run_bzr(['init-shared-repo', 'foo'])
167
167
        self.assertEqual(err, '')
168
168
        self.assertTrue(os.path.exists('foo'))