~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/bzrdir_implementations/test_bzrdir.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-02-10 06:29:49 UTC
  • mfrom: (3995.1.1 ianc-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090210062949-kj7rpejso2405ug1
Add --no-tree option to bzr branch (Daniel Watkins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
191
191
                              % a_bzrdir.transport)
192
192
 
193
193
    def sproutOrSkip(self, from_bzrdir, to_url, revision_id=None,
194
 
                     force_new_repo=False, accelerator_tree=None):
 
194
                     force_new_repo=False, accelerator_tree=None,
 
195
                     create_tree_if_local=True):
195
196
        """Sprout from_bzrdir into to_url, or raise TestSkipped.
196
197
        
197
198
        A simple wrapper for from_bzrdir.sprout that translates NotLocalUrl into
203
204
        target = from_bzrdir.sprout(to_url, revision_id=revision_id,
204
205
                                    force_new_repo=force_new_repo,
205
206
                                    possible_transports=[to_transport],
206
 
                                    accelerator_tree=accelerator_tree)
 
207
                                    accelerator_tree=accelerator_tree,
 
208
                                    create_tree_if_local=create_tree_if_local)
207
209
        return target
208
210
 
209
211
    def test_create_null_workingtree(self):
1120
1122
                                   accelerator_tree=tree)
1121
1123
        self.assertEqual(['2'], target.open_workingtree().get_parent_ids())
1122
1124
 
 
1125
    def test_sprout_branch_no_tree(self):
 
1126
        tree = self.make_branch_and_tree('source')
 
1127
        self.build_tree(['source/foo'])
 
1128
        tree.add('foo')
 
1129
        tree.commit('revision 1', rev_id='1')
 
1130
        tree.commit('revision 2', rev_id='2', allow_pointless=True)
 
1131
        dir = tree.bzrdir
 
1132
        if isinstance(dir, (bzrdir.BzrDirPreSplitOut,)):
 
1133
            self.assertRaises(errors.MustHaveWorkingTree, self.sproutOrSkip,
 
1134
                              dir, self.get_url('target'),
 
1135
                              create_tree_if_local=False)
 
1136
            return
 
1137
        target = self.sproutOrSkip(dir, self.get_url('target'),
 
1138
                                   create_tree_if_local=False)
 
1139
        self.failIfExists('target/foo')
 
1140
        self.assertEqual(tree.branch.last_revision(),
 
1141
                         target.open_branch().last_revision())
 
1142
 
1123
1143
    def test_format_initialize_find_open(self):
1124
1144
        # loopback test to check the current format initializes to itself.
1125
1145
        if not self.bzrdir_format.is_supported():