~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_branch.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-07-01 17:30:04 UTC
  • mfrom: (4498.3.1 integration2)
  • Revision ID: pqm@pqm.ubuntu.com-20090701173004-xmeu77pfroy9iklo
(bialix) Add --use-existing-dir to branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
113
113
        self.failIfExists('target/hello')
114
114
        self.failIfExists('target/goodbye')
115
115
 
 
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',
 
126
            err)
 
127
        # force operation
 
128
        self.run_bzr('branch a b --use-existing-dir')
 
129
        # check conflicts
 
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)
 
136
 
116
137
 
117
138
class TestBranchStacked(ExternalBase):
118
139
    """Tests for branch --stacked"""