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

  • Committer: Jelmer Vernooij
  • Date: 2017-05-21 19:09:26 UTC
  • mfrom: (6622.1.36 breezy)
  • Revision ID: jelmer@jelmer.uk-20170521190926-5vtz8xaf0e9ylrpc
Merge rename to breezy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
 
18
 
"""Black-box tests for bzr branch."""
 
18
"""Black-box tests for brz branch."""
19
19
 
20
20
import os
21
21
 
22
 
from bzrlib import (
 
22
from breezy import (
23
23
    branch,
24
24
    bzrdir,
25
25
    controldir,
27
27
    revision as _mod_revision,
28
28
    tests,
29
29
    )
30
 
from bzrlib.repofmt.knitrepo import RepositoryFormatKnit1
31
 
from bzrlib.tests import (
 
30
from breezy.repofmt.knitrepo import RepositoryFormatKnit1
 
31
from breezy.tests import (
32
32
    fixtures,
33
33
    test_server,
34
34
    )
35
 
from bzrlib.tests.features import (
 
35
from breezy.tests.features import (
36
36
    HardlinkFeature,
37
37
    )
38
 
from bzrlib.tests.blackbox import test_switch
39
 
from bzrlib.tests.matchers import ContainsNoVfsCalls
40
 
from bzrlib.tests.test_sftp_transport import TestCaseWithSFTPServer
41
 
from bzrlib.tests.script import run_script
42
 
from bzrlib.urlutils import local_path_to_url, strip_trailing_slash
43
 
from bzrlib.workingtree import WorkingTree
 
38
from breezy.tests.blackbox import test_switch
 
39
from breezy.tests.matchers import ContainsNoVfsCalls
 
40
from breezy.tests.test_sftp_transport import TestCaseWithSFTPServer
 
41
from breezy.tests.script import run_script
 
42
from breezy.urlutils import local_path_to_url, strip_trailing_slash
 
43
from breezy.workingtree import WorkingTree
44
44
 
45
45
 
46
46
class TestBranch(tests.TestCaseWithTransport):
92
92
        out,err = self.run_bzr('branch a file:b,branch=orig', retcode=3)
93
93
        self.assertEqual('', out)
94
94
        self.assertEqual(
95
 
            'bzr: ERROR: Already a branch: "file:b,branch=orig".\n', err)
 
95
            'brz: ERROR: Already a branch: "file:b,branch=orig".\n', err)
96
96
 
97
97
    def test_from_colocated(self):
98
98
        """Branch from a colocated branch into a regular branch."""
289
289
 
290
290
    def test_branch_into_existing_dir(self):
291
291
        self.example_branch('a')
292
 
        # existing dir with similar files but no .bzr dir
 
292
        # existing dir with similar files but no .brz dir
293
293
        self.build_tree_contents([('b/',)])
294
294
        self.build_tree_contents([('b/hello', 'bar')])  # different content
295
295
        self.build_tree_contents([('b/goodbye', 'baz')])# same content
296
296
        # fails without --use-existing-dir
297
297
        out,err = self.run_bzr('branch a b', retcode=3)
298
298
        self.assertEqual('', out)
299
 
        self.assertEqual('bzr: ERROR: Target directory "b" already exists.\n',
 
299
        self.assertEqual('brz: ERROR: Target directory "b" already exists.\n',
300
300
            err)
301
301
        # force operation
302
302
        self.run_bzr('branch a b --use-existing-dir')
306
306
        # we can't branch into branch
307
307
        out,err = self.run_bzr('branch a b --use-existing-dir', retcode=3)
308
308
        self.assertEqual('', out)
309
 
        self.assertEqual('bzr: ERROR: Already a branch: "b".\n', err)
 
309
        self.assertEqual('brz: ERROR: Already a branch: "b".\n', err)
310
310
 
311
311
    def test_branch_bind(self):
312
312
        self.example_branch('a')
615
615
class TestDeprecatedAliases(tests.TestCaseWithTransport):
616
616
 
617
617
    def test_deprecated_aliases(self):
618
 
        """bzr branch can be called clone or get, but those names are
 
618
        """brz branch can be called clone or get, but those names are
619
619
        deprecated.
620
620
 
621
621
        See bug 506265.
622
622
        """
623
623
        for command in ['clone', 'get']:
624
624
            run_script(self, """
625
 
            $ bzr %(command)s A B
626
 
            2>The command 'bzr %(command)s' has been deprecated in bzr 2.4. Please use 'bzr branch' instead.
627
 
            2>bzr: ERROR: Not a branch...
 
625
            $ brz %(command)s A B
 
626
            2>The command 'brz %(command)s' has been deprecated in brz 2.4. Please use 'brz branch' instead.
 
627
            2>brz: ERROR: Not a branch...
628
628
            """ % locals())
629
629
 
630
630
 
632
632
 
633
633
    def _checkout_and_branch(self, option=''):
634
634
        self.script_runner.run_script(self, '''
635
 
                $ bzr checkout %(option)s repo/trunk checkout
 
635
                $ brz checkout %(option)s repo/trunk checkout
636
636
                $ cd checkout
637
 
                $ bzr branch --switch ../repo/trunk ../repo/branched
 
637
                $ brz branch --switch ../repo/trunk ../repo/branched
638
638
                2>Branched 0 revisions.
639
639
                2>Tree is up to date at revision 0.
640
640
                2>Switched to branch:...branched...
645
645
        return (bound_branch, master_branch)
646
646
 
647
647
    def test_branch_switch_parent_lightweight(self):
648
 
        """Lightweight checkout using bzr branch --switch."""
 
648
        """Lightweight checkout using brz branch --switch."""
649
649
        bb, mb = self._checkout_and_branch(option='--lightweight')
650
650
        self.assertParent('repo/trunk', bb)
651
651
        self.assertParent('repo/trunk', mb)
652
652
 
653
653
    def test_branch_switch_parent_heavyweight(self):
654
 
        """Heavyweight checkout using bzr branch --switch."""
 
654
        """Heavyweight checkout using brz branch --switch."""
655
655
        bb, mb = self._checkout_and_branch()
656
656
        self.assertParent('repo/trunk', bb)
657
657
        self.assertParent('repo/trunk', mb)