~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: 2007-06-28 07:08:27 UTC
  • mfrom: (2553.1.3 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20070628070827-h5s313dg5tnag9vj
(robertc) Show the names of commit hooks during commit.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
from bzrlib import branch, bzrdir
23
23
from bzrlib.repofmt.knitrepo import RepositoryFormatKnit1
24
24
from bzrlib.tests.blackbox import ExternalBase
25
 
from bzrlib.tests.test_sftp_transport import TestCaseWithSFTPServer
26
25
from bzrlib.workingtree import WorkingTree
27
26
 
28
27
 
82
81
 
83
82
        # Now that we have a repository with shared files, make sure
84
83
        # that things aren't copied out by a 'branch'
85
 
        self.run_bzr('branch repo/b branch-b')
 
84
        self.run_bzr('branch', 'repo/b', 'branch-b')
86
85
        pushed_tree = WorkingTree.open('branch-b')
87
86
        pushed_repo = pushed_tree.branch.repository
88
87
        self.assertFalse(pushed_repo.has_revision('a-1'))
90
89
        self.assertTrue(pushed_repo.has_revision('b-1'))
91
90
 
92
91
 
93
 
class TestRemoteBranch(TestCaseWithSFTPServer):
94
 
 
95
 
    def setUp(self):
96
 
        super(TestRemoteBranch, self).setUp()
97
 
        tree = self.make_branch_and_tree('branch')
98
 
        self.build_tree_contents([('branch/file', 'file content\n')])
99
 
        tree.add('file')
100
 
        tree.commit('file created')
101
 
 
102
 
    def test_branch_local_remote(self):
103
 
        self.run_bzr(['branch', 'branch', self.get_url('remote')])
104
 
        t = self.get_transport()
105
 
        # Ensure that no working tree what created remotely
106
 
        self.assertFalse(t.has('remote/file'))
107
 
 
108
 
    def test_branch_remote_remote(self):
109
 
        # Light cheat: we access the branch remotely
110
 
        self.run_bzr(['branch', self.get_url('branch'),
111
 
                      self.get_url('remote')])
112
 
        t = self.get_transport()
113
 
        # Ensure that no working tree what created remotely
114
 
        self.assertFalse(t.has('remote/file'))
115