~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: 2007-12-20 16:16:34 UTC
  • mfrom: (3123.5.18 hardlinks)
  • Revision ID: pqm@pqm.ubuntu.com-20071220161634-2kcjb650o21ydko4
Accelerate build_tree using similar workingtrees (abentley)

Show diffs side-by-side

added added

removed removed

Lines of Context:
187
187
                              % a_bzrdir.transport)
188
188
 
189
189
    def sproutOrSkip(self, from_bzrdir, to_url, revision_id=None,
190
 
                     force_new_repo=False):
 
190
                     force_new_repo=False, accelerator_tree=None):
191
191
        """Sprout from_bzrdir into to_url, or raise TestSkipped.
192
192
        
193
193
        A simple wrapper for from_bzrdir.sprout that translates NotLocalUrl into
198
198
            raise TestSkipped('Cannot sprout to remote bzrdirs.')
199
199
        target = from_bzrdir.sprout(to_url, revision_id=revision_id,
200
200
                                    force_new_repo=force_new_repo,
201
 
                                    possible_transports=[to_transport])
 
201
                                    possible_transports=[to_transport],
 
202
                                    accelerator_tree=accelerator_tree)
202
203
        return target
203
204
 
204
205
    def test_create_null_workingtree(self):
1080
1081
        target = self.sproutOrSkip(dir, self.get_url('target'), revision_id='1')
1081
1082
        self.assertEqual(['1'], target.open_workingtree().get_parent_ids())
1082
1083
 
 
1084
    def test_sprout_takes_accelerator(self):
 
1085
        tree = self.make_branch_and_tree('source')
 
1086
        self.build_tree(['source/foo'])
 
1087
        tree.add('foo')
 
1088
        tree.commit('revision 1', rev_id='1')
 
1089
        tree.commit('revision 2', rev_id='2', allow_pointless=True)
 
1090
        dir = tree.bzrdir
 
1091
        target = self.sproutOrSkip(dir, self.get_url('target'),
 
1092
                                   accelerator_tree=tree)
 
1093
        self.assertEqual(['2'], target.open_workingtree().get_parent_ids())
 
1094
 
1083
1095
    def test_format_initialize_find_open(self):
1084
1096
        # loopback test to check the current format initializes to itself.
1085
1097
        if not self.bzrdir_format.is_supported():