/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 bzrlib/tests/test_foreign.py

  • Committer: Jelmer Vernooij
  • Date: 2009-01-31 00:03:59 UTC
  • mto: (3920.2.35 dpush)
  • mto: This revision was merged to the branch mainline in revision 4281.
  • Revision ID: jelmer@samba.org-20090131000359-l7b460hw33dd24pz
Override BzrDir.sprout() to avoid accelerator_tree's from being used.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
    BzrDirFormat,
28
28
    BzrDirMeta1,
29
29
    BzrDirMetaFormat1,
 
30
    format_registry,
30
31
    )
31
32
from bzrlib.inventory import Inventory
32
33
from bzrlib.revision import Revision
132
133
        self.root_transport = _transport
133
134
        self._mode_check_done = False
134
135
 
 
136
    def cloning_metadir(self, stacked=False):
 
137
        """Produce a metadir suitable for cloning with."""
 
138
        return format_registry.make_bzrdir("default")
 
139
 
 
140
    def sprout(self, url, revision_id=None, force_new_repo=False,
 
141
               recurse='down', possible_transports=None,
 
142
               accelerator_tree=None, hardlink=False, stacked=False,
 
143
               source_branch=None):
 
144
        # dirstate doesn't cope with accelerator_trees well 
 
145
        # that have a different control dir
 
146
        return super(DummyForeignVcsDir, self).sprout(url=url, 
 
147
                revision_id=revision_id, force_new_repo=force_new_repo, 
 
148
                recurse=recurse, possible_transports=possible_transports, 
 
149
                hardlink=hardlink, stacked=stacked, source_branch=source_branch)
 
150
 
135
151
 
136
152
class ForeignVcsRegistryTests(TestCase):
137
153
    """Tests for the ForeignVcsRegistry class."""
264
280
        dir.open_workingtree()
265
281
 
266
282
    def test_sprout(self):
267
 
        """Test we can clone dummies and that the format is preserved."""
 
283
        """Test we can clone dummies and that the format is not preserved."""
268
284
        self.make_branch_and_tree("d", format=DummyForeignVcsDirFormat())
269
285
        dir = BzrDir.open("d")
270
286
        newdir = dir.sprout("e")
271
 
        self.assertEquals("A Dummy VCS Dir", newdir._format.get_format_string())
 
287
        self.assertNotEquals("A Dummy VCS Dir", newdir._format.get_format_string())