104
105
"""Init creates no default ignore rules."""
105
106
self.run_bzr('init')
106
107
self.assertFalse(os.path.exists('.bzrignore'))
110
class TestSFTPInit(TestCaseWithSFTPServer):
113
# init on a remote url should succeed.
114
out, err = self.run_bzr('init', self.get_url())
115
self.assertEqual('', out)
116
self.assertEqual('', err)
118
def test_init_existing_branch(self):
119
# when there is already a branch present, make mention
120
self.make_branch('.')
122
# rely on SFTPServer get_url() pointing at '.'
123
out, err = self.run_bzr_error(['Already a branch'], 'init', self.get_url())
125
# make sure using 'bzr checkout' is not suggested
126
# for remote locations missing a working tree
127
self.assertFalse(re.search(r'checkout', err))
129
def test_init_existing_branch_with_workingtree(self):
130
# don't distinguish between the branch having a working tree or not
131
# when the branch itself is remote.
132
self.make_branch_and_tree('.')
134
# rely on SFTPServer get_url() pointing at '.'
135
self.run_bzr_error(['Already a branch'], 'init', self.get_url())