/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 brzlib/tests/blackbox/test_branch.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-21 15:09:40 UTC
  • mto: This revision was merged to the branch mainline in revision 6623.
  • Revision ID: jelmer@jelmer.uk-20170521150940-v0kb1o7ebd9vmqjw
Fix some more tests.

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
 
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')
463
463
        # We should notify the user that we upgraded their format
464
464
        self.assertEqualDiff(
465
465
            'Source repository format does not support stacking, using format:\n'
466
 
            '  Packs 5 (adds stacking support, requires bzr 1.6)\n'
 
466
            '  Packs 5 (adds stacking support, requires brz 1.6)\n'
467
467
            'Source branch format does not support stacking, using format:\n'
468
468
            '  Branch format 7\n'
469
469
            'Doing on-the-fly conversion from RepositoryFormatKnitPack1() to RepositoryFormatKnitPack5().\n'
478
478
        # We should notify the user that we upgraded their format
479
479
        self.assertEqualDiff(
480
480
            'Source repository format does not support stacking, using format:\n'
481
 
            '  Packs 5 rich-root (adds stacking support, requires bzr 1.6.1)\n'
 
481
            '  Packs 5 rich-root (adds stacking support, requires brz 1.6.1)\n'
482
482
            'Source branch format does not support stacking, using format:\n'
483
483
            '  Branch format 7\n'
484
484
            'Doing on-the-fly conversion from RepositoryFormatKnitPack4() to RepositoryFormatKnitPack5RichRoot().\n'
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)