113
113
self.failIfExists('target/hello')
114
114
self.failIfExists('target/goodbye')
116
def test_branch_into_existing_dir(self):
117
self.example_branch('a')
118
# existing dir with similar files but no .bzr dir
119
self.build_tree_contents([('b/',)])
120
self.build_tree_contents([('b/hello', 'bar')]) # different content
121
self.build_tree_contents([('b/goodbye', 'baz')])# same content
122
# fails without --use-existing-dir
123
out,err = self.run_bzr('branch a b', retcode=3)
124
self.assertEqual('', out)
125
self.assertEqual('bzr: ERROR: Target directory "b" already exists.\n',
128
self.run_bzr('branch a b --use-existing-dir')
130
self.failUnlessExists('b/hello.moved')
131
self.failIfExists('b/godbye.moved')
132
# we can't branch into branch
133
out,err = self.run_bzr('branch a b --use-existing-dir', retcode=3)
134
self.assertEqual('', out)
135
self.assertEqual('bzr: ERROR: Already a branch: "b".\n', err)
117
138
class TestBranchStacked(ExternalBase):
118
139
"""Tests for branch --stacked"""