~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Jelmer Vernooij
  • Date: 2011-04-05 01:12:15 UTC
  • mto: This revision was merged to the branch mainline in revision 5757.
  • Revision ID: jelmer@samba.org-20110405011215-8g6izwf3uz8v4174
Remove some unnecessary imports, clean up lazy imports.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
    test_server,
34
34
    )
35
35
from bzrlib.tests.test_sftp_transport import TestCaseWithSFTPServer
36
 
from bzrlib.tests.script import run_script
37
36
from bzrlib.urlutils import local_path_to_url, strip_trailing_slash
38
37
from bzrlib.workingtree import WorkingTree
39
38
 
180
179
        source.add('file1')
181
180
        source.commit('added file')
182
181
        out, err = self.run_bzr('branch source target --files-from source')
183
 
        self.assertPathExists('target/file1')
 
182
        self.failUnlessExists('target/file1')
184
183
 
185
184
    def test_branch_files_from_hardlink(self):
186
185
        self.requireFeature(HardlinkFeature)
209
208
    def test_branch_no_tree(self):
210
209
        self.example_branch('source')
211
210
        self.run_bzr('branch --no-tree source target')
212
 
        self.assertPathDoesNotExist('target/hello')
213
 
        self.assertPathDoesNotExist('target/goodbye')
 
211
        self.failIfExists('target/hello')
 
212
        self.failIfExists('target/goodbye')
214
213
 
215
214
    def test_branch_into_existing_dir(self):
216
215
        self.example_branch('a')
226
225
        # force operation
227
226
        self.run_bzr('branch a b --use-existing-dir')
228
227
        # check conflicts
229
 
        self.assertPathExists('b/hello.moved')
230
 
        self.assertPathDoesNotExist('b/godbye.moved')
 
228
        self.failUnlessExists('b/hello.moved')
 
229
        self.failIfExists('b/godbye.moved')
231
230
        # we can't branch into branch
232
231
        out,err = self.run_bzr('branch a b --use-existing-dir', retcode=3)
233
232
        self.assertEqual('', out)
502
501
        # Ensure that no working tree what created remotely
503
502
        self.assertFalse(t.has('remote/file'))
504
503
 
505
 
 
506
 
class TestDeprecatedAliases(TestCaseWithTransport):
507
 
 
508
 
    def test_deprecated_aliases(self):
509
 
        """bzr branch can be called clone or get, but those names are deprecated.
510
 
 
511
 
        See bug 506265.
512
 
        """
513
 
        for command in ['clone', 'get']:
514
 
            run_script(self, """
515
 
            $ bzr %(command)s A B
516
 
            2>The command 'bzr %(command)s' has been deprecated in bzr 2.4. Please use 'bzr branch' instead.
517
 
            2>bzr: ERROR: Not a branch...
518
 
            """ % locals())