~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_bundle.py

  • Committer: Aaron Bentley
  • Date: 2006-09-20 14:03:05 UTC
  • mto: This revision was merged to the branch mainline in revision 2162.
  • Revision ID: abentley@panoramicfeedback.com-20060920140305-7726fe3eb92690b1
Get tree._iter_changed down to ~ 1 stat per file

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2004, 2005, 2006, 2007 Canonical Ltd
 
1
# Copyright (C) 2004-2006 by Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
19
19
import sys
20
20
import tempfile
21
21
 
22
 
from bzrlib import (
23
 
    bzrdir,
24
 
    errors,
25
 
    inventory,
26
 
    repository,
27
 
    revision as _mod_revision,
28
 
    treebuilder,
29
 
    )
30
 
from bzrlib.builtins import _merge_helper
 
22
from bzrlib import inventory, treebuilder
 
23
from bzrlib.builtins import merge
31
24
from bzrlib.bzrdir import BzrDir
32
25
from bzrlib.bundle.apply_bundle import install_bundle, merge_bundle
33
26
from bzrlib.bundle.bundle_data import BundleTree
34
27
from bzrlib.bundle.serializer import write_bundle, read_bundle
35
 
from bzrlib.bundle.serializer.v08 import BundleSerializerV08
36
 
from bzrlib.bundle.serializer.v09 import BundleSerializerV09
37
28
from bzrlib.branch import Branch
38
29
from bzrlib.diff import internal_diff
39
30
from bzrlib.errors import (BzrError, TestamentMismatch, NotABundle, BadBundle, 
40
31
                           NoSuchFile,)
41
32
from bzrlib.merge import Merge3Merger
42
 
from bzrlib.repofmt import knitrepo
43
33
from bzrlib.osutils import has_symlinks, sha_file
44
34
from bzrlib.tests import (TestCaseInTempDir, TestCaseWithTransport,
45
35
                          TestCase, TestSkipped)
311
301
            [inventory.ROOT_ID, 'a', 'b', 'd', 'e'])
312
302
 
313
303
 
314
 
class BundleTester1(TestCaseWithTransport):
315
 
 
316
 
    def test_mismatched_bundle(self):
317
 
        format = bzrdir.BzrDirMetaFormat1()
318
 
        format.repository_format = knitrepo.RepositoryFormatKnit3()
319
 
        serializer = BundleSerializerV08('0.8')
320
 
        b = self.make_branch('.', format=format)
321
 
        self.assertRaises(errors.IncompatibleBundleFormat, serializer.write, 
322
 
                          b.repository, [], {}, StringIO())
323
 
 
324
 
    def test_matched_bundle(self):
325
 
        """Don't raise IncompatibleBundleFormat for knit2 and bundle0.9"""
326
 
        format = bzrdir.BzrDirMetaFormat1()
327
 
        format.repository_format = knitrepo.RepositoryFormatKnit3()
328
 
        serializer = BundleSerializerV09('0.9')
329
 
        b = self.make_branch('.', format=format)
330
 
        serializer.write(b.repository, [], {}, StringIO())
331
 
 
332
 
    def test_mismatched_model(self):
333
 
        """Try copying a bundle from knit2 to knit1"""
334
 
        format = bzrdir.BzrDirMetaFormat1()
335
 
        format.repository_format = knitrepo.RepositoryFormatKnit3()
336
 
        source = self.make_branch_and_tree('source', format=format)
337
 
        source.commit('one', rev_id='one-id')
338
 
        source.commit('two', rev_id='two-id')
339
 
        text = StringIO()
340
 
        write_bundle(source.branch.repository, 'two-id', 'null:', text,
341
 
                     format='0.9')
342
 
        text.seek(0)
343
 
 
344
 
        format = bzrdir.BzrDirMetaFormat1()
345
 
        format.repository_format = knitrepo.RepositoryFormatKnit1()
346
 
        target = self.make_branch('target', format=format)
347
 
        self.assertRaises(errors.IncompatibleRevision, install_bundle, 
348
 
                          target.repository, read_bundle(text))
349
 
 
350
 
 
351
 
class V08BundleTester(TestCaseWithTransport):
352
 
 
353
 
    format = '0.8'
354
 
 
355
 
    def bzrdir_format(self):
356
 
        format = bzrdir.BzrDirMetaFormat1()
357
 
        format.repository_format = knitrepo.RepositoryFormatKnit1()
358
 
        return format
359
 
 
360
 
    def make_branch_and_tree(self, path, format=None):
361
 
        if format is None:
362
 
            format = self.bzrdir_format()
363
 
        return TestCaseWithTransport.make_branch_and_tree(self, path, format)
364
 
 
365
 
    def make_branch(self, path, format=None):
366
 
        if format is None:
367
 
            format = self.bzrdir_format()
368
 
        return TestCaseWithTransport.make_branch(self, path, format)
 
304
class BundleTester(TestCaseWithTransport):
369
305
 
370
306
    def create_bundle_text(self, base_rev_id, rev_id):
371
307
        bundle_txt = StringIO()
372
308
        rev_ids = write_bundle(self.b1.repository, rev_id, base_rev_id, 
373
 
                               bundle_txt, format=self.format)
 
309
                               bundle_txt)
374
310
        bundle_txt.seek(0)
375
311
        self.assertEqual(bundle_txt.readline(), 
376
 
                         '# Bazaar revision bundle v%s\n' % self.format)
 
312
                         '# Bazaar revision bundle v0.8\n')
377
313
        self.assertEqual(bundle_txt.readline(), '#\n')
378
314
 
379
315
        rev = self.b1.repository.get_revision(rev_id)
455
391
        else:
456
392
            if not os.path.exists(checkout_dir):
457
393
                os.mkdir(checkout_dir)
458
 
        tree = self.make_branch_and_tree(checkout_dir)
 
394
        tree = BzrDir.create_standalone_workingtree(checkout_dir)
459
395
        s = StringIO()
460
 
        ancestors = write_bundle(self.b1.repository, rev_id, 'null:', s,
461
 
                                 format=self.format)
 
396
        ancestors = write_bundle(self.b1.repository, rev_id, None, s)
462
397
        s.seek(0)
463
398
        assert isinstance(s.getvalue(), str), (
464
399
            "Bundle isn't a bytestring:\n %s..." % repr(s.getvalue())[:40])
483
418
                    continue
484
419
                self.assertEqual(old_file.read(),
485
420
                                 new.get_file(inventory_id).read())
486
 
        if not _mod_revision.is_null(rev_id):
 
421
        if rev_id is not None:
487
422
            rh = self.b1.revision_history()
488
423
            tree.branch.set_revision_history(rh[:rh.index(rev_id)+1])
489
424
            tree.update()
490
425
            delta = tree.changes_from(self.b1.repository.revision_tree(rev_id))
491
426
            self.assertFalse(delta.has_changed(),
492
 
                             'Working tree has modifications: %s' % delta)
 
427
                             'Working tree has modifications')
493
428
        return tree
494
429
 
495
430
    def valid_apply_bundle(self, base_rev_id, info, checkout_dir=None):
550
485
        self.tree1.add('one')
551
486
        self.tree1.commit('add one', rev_id='a@cset-0-1')
552
487
 
553
 
        bundle = self.get_valid_bundle('null:', 'a@cset-0-1')
 
488
        bundle = self.get_valid_bundle(None, 'a@cset-0-1')
554
489
        # FIXME: The current write_bundle api no longer supports
555
490
        #        setting a custom summary message
556
491
        #        We should re-introduce the ability, and update
592
527
        bundle = self.get_valid_bundle('a@cset-0-1', 'a@cset-0-2')
593
528
 
594
529
        # Check a rollup bundle 
595
 
        bundle = self.get_valid_bundle('null:', 'a@cset-0-2')
 
530
        bundle = self.get_valid_bundle(None, 'a@cset-0-2')
596
531
 
597
532
        # Now delete entries
598
533
        self.tree1.remove(
610
545
        self.assertRaises(TestamentMismatch, self.get_invalid_bundle, 
611
546
                          'a@cset-0-2', 'a@cset-0-3')
612
547
        # Check a rollup bundle 
613
 
        bundle = self.get_valid_bundle('null:', 'a@cset-0-3')
 
548
        bundle = self.get_valid_bundle(None, 'a@cset-0-3')
614
549
 
615
550
        # Now move the directory
616
551
        self.tree1.rename_one('dir', 'sub/dir')
618
553
 
619
554
        bundle = self.get_valid_bundle('a@cset-0-3', 'a@cset-0-4')
620
555
        # Check a rollup bundle 
621
 
        bundle = self.get_valid_bundle('null:', 'a@cset-0-4')
 
556
        bundle = self.get_valid_bundle(None, 'a@cset-0-4')
622
557
 
623
558
        # Modified files
624
559
        open('b1/sub/dir/WithCaps.txt', 'ab').write('\nAdding some text\n')
636
571
                          verbose=False)
637
572
        bundle = self.get_valid_bundle('a@cset-0-5', 'a@cset-0-6')
638
573
        other = self.get_checkout('a@cset-0-5')
639
 
        tree1_inv = self.tree1.branch.repository.get_inventory_xml(
640
 
            'a@cset-0-5')
641
 
        tree2_inv = other.branch.repository.get_inventory_xml('a@cset-0-5')
642
 
        self.assertEqualDiff(tree1_inv, tree2_inv)
643
574
        other.rename_one('sub/dir/nolastnewline.txt', 'sub/nolastnewline.txt')
644
575
        other.commit('rename file', rev_id='a@cset-0-6b')
645
 
        _merge_helper([other.basedir, -1], [None, None],
646
 
                      this_dir=self.tree1.basedir)
 
576
        merge([other.basedir, -1], [None, None], this_dir=self.tree1.basedir)
647
577
        self.tree1.commit(u'Merge', rev_id='a@cset-0-7',
648
578
                          verbose=False)
649
579
        bundle = self.get_valid_bundle('a@cset-0-6', 'a@cset-0-7')
651
581
    def test_symlink_bundle(self):
652
582
        if not has_symlinks():
653
583
            raise TestSkipped("No symlink support")
654
 
        self.tree1 = self.make_branch_and_tree('b1')
 
584
        self.tree1 = BzrDir.create_standalone_workingtree('b1')
655
585
        self.b1 = self.tree1.branch
656
586
        tt = TreeTransform(self.tree1)
657
587
        tt.new_symlink('link', tt.root, 'bar/foo', 'link-1')
658
588
        tt.apply()
659
589
        self.tree1.commit('add symlink', rev_id='l@cset-0-1')
660
 
        self.get_valid_bundle('null:', 'l@cset-0-1')
 
590
        self.get_valid_bundle(None, 'l@cset-0-1')
661
591
        tt = TreeTransform(self.tree1)
662
592
        trans_id = tt.trans_id_tree_file_id('link-1')
663
593
        tt.adjust_path('link2', tt.root, trans_id)
681
611
        self.get_valid_bundle('l@cset-0-3', 'l@cset-0-4')
682
612
 
683
613
    def test_binary_bundle(self):
684
 
        self.tree1 = self.make_branch_and_tree('b1')
 
614
        self.tree1 = BzrDir.create_standalone_workingtree('b1')
685
615
        self.b1 = self.tree1.branch
686
616
        tt = TreeTransform(self.tree1)
687
617
        
690
620
        tt.new_file('file2', tt.root, '\x01\n\x02\r\x03\n\x04\r\xff', 'binary-2')
691
621
        tt.apply()
692
622
        self.tree1.commit('add binary', rev_id='b@cset-0-1')
693
 
        self.get_valid_bundle('null:', 'b@cset-0-1')
 
623
        self.get_valid_bundle(None, 'b@cset-0-1')
694
624
 
695
625
        # Delete
696
626
        tt = TreeTransform(self.tree1)
720
650
        self.get_valid_bundle('b@cset-0-3', 'b@cset-0-4')
721
651
 
722
652
        # Rollup
723
 
        self.get_valid_bundle('null:', 'b@cset-0-4')
 
653
        self.get_valid_bundle(None, 'b@cset-0-4')
724
654
 
725
655
    def test_last_modified(self):
726
 
        self.tree1 = self.make_branch_and_tree('b1')
 
656
        self.tree1 = BzrDir.create_standalone_workingtree('b1')
727
657
        self.b1 = self.tree1.branch
728
658
        tt = TreeTransform(self.tree1)
729
659
        tt.new_file('file', tt.root, 'file', 'file')
744
674
        tt.create_file('file2', trans_id)
745
675
        tt.apply()
746
676
        other.commit('modify text in another tree', rev_id='a@lmod-0-2b')
747
 
        _merge_helper([other.basedir, -1], [None, None],
748
 
                      this_dir=self.tree1.basedir)
 
677
        merge([other.basedir, -1], [None, None], this_dir=self.tree1.basedir)
749
678
        self.tree1.commit(u'Merge', rev_id='a@lmod-0-3',
750
679
                          verbose=False)
751
680
        self.tree1.commit(u'Merge', rev_id='a@lmod-0-4')
752
681
        bundle = self.get_valid_bundle('a@lmod-0-2a', 'a@lmod-0-4')
753
682
 
754
683
    def test_hide_history(self):
755
 
        self.tree1 = self.make_branch_and_tree('b1')
 
684
        self.tree1 = BzrDir.create_standalone_workingtree('b1')
756
685
        self.b1 = self.tree1.branch
757
686
 
758
687
        open('b1/one', 'wb').write('one\n')
764
693
        self.tree1.commit('modify', rev_id='a@cset-0-3')
765
694
        bundle_file = StringIO()
766
695
        rev_ids = write_bundle(self.tree1.branch.repository, 'a@cset-0-3',
767
 
                               'a@cset-0-1', bundle_file, format=self.format)
768
 
        self.assertNotContainsRe(bundle_file.getvalue(), '\btwo\b')
 
696
                               'a@cset-0-1', bundle_file)
 
697
        self.assertNotContainsRe(bundle_file.getvalue(), 'two')
769
698
        self.assertContainsRe(bundle_file.getvalue(), 'one')
770
699
        self.assertContainsRe(bundle_file.getvalue(), 'three')
771
700
 
785
714
            u'William Dod\xe9\n').encode('utf-8'))
786
715
        f.close()
787
716
 
788
 
        self.tree1.add([u'with Dod\xe9'], ['withdod-id'])
789
 
        self.tree1.commit(u'i18n commit from William Dod\xe9',
 
717
        self.tree1.add([u'with Dod\xe9'])
 
718
        self.tree1.commit(u'i18n commit from William Dod\xe9', 
790
719
                          rev_id='i18n-1', committer=u'William Dod\xe9')
791
720
 
792
 
        if sys.platform == 'darwin':
793
 
            # On Mac the '\xe9' gets changed to 'e\u0301'
794
 
            self.assertEqual([u'.bzr', u'with Dode\u0301'],
795
 
                             sorted(os.listdir(u'b1')))
796
 
            delta = self.tree1.changes_from(self.tree1.basis_tree())
797
 
            self.assertEqual([(u'with Dod\xe9', 'withdod-id', 'file')],
798
 
                             delta.removed)
799
 
            self.knownFailure("Mac OSX doesn't preserve unicode"
800
 
                              " combining characters.")
801
 
 
802
721
        # Add
803
 
        bundle = self.get_valid_bundle('null:', 'i18n-1')
 
722
        bundle = self.get_valid_bundle(None, 'i18n-1')
804
723
 
805
724
        # Modified
806
725
        f = open(u'b1/with Dod\xe9', 'wb')
824
743
        bundle = self.get_valid_bundle('i18n-3', 'i18n-4')
825
744
 
826
745
        # Rollup
827
 
        bundle = self.get_valid_bundle('null:', 'i18n-4')
 
746
        bundle = self.get_valid_bundle(None, 'i18n-4')
828
747
 
829
748
 
830
749
    def test_whitespace_bundle(self):
842
761
        # Added
843
762
        self.tree1.commit('funky whitespace', rev_id='white-1')
844
763
 
845
 
        bundle = self.get_valid_bundle('null:', 'white-1')
 
764
        bundle = self.get_valid_bundle(None, 'white-1')
846
765
 
847
766
        # Modified
848
767
        open('b1/trailing space ', 'ab').write('add some text\n')
863
782
        bundle = self.get_valid_bundle('white-3', 'white-4')
864
783
        
865
784
        # Now test a complet roll-up
866
 
        bundle = self.get_valid_bundle('null:', 'white-4')
 
785
        bundle = self.get_valid_bundle(None, 'white-4')
867
786
 
868
787
    def test_alt_timezone_bundle(self):
869
788
        self.tree1 = self.make_branch_and_memory_tree('b1')
879
798
        self.tree1.commit('non-hour offset timezone', rev_id='tz-1',
880
799
                          timezone=19800, timestamp=1152544886.0)
881
800
 
882
 
        bundle = self.get_valid_bundle('null:', 'tz-1')
 
801
        bundle = self.get_valid_bundle(None, 'tz-1')
883
802
        
884
803
        rev = bundle.revisions[0]
885
804
        self.assertEqual('Mon 2006-07-10 20:51:26.000000000 +0530', rev.date)
891
810
        self.tree1 = self.make_branch_and_tree('b1')
892
811
        self.b1 = self.tree1.branch
893
812
        self.tree1.commit('message', rev_id='revid1')
894
 
        bundle = self.get_valid_bundle('null:', 'revid1')
 
813
        bundle = self.get_valid_bundle(None, 'revid1')
895
814
        tree = bundle.revision_tree(self.b1.repository, 'revid1')
896
815
        self.assertEqual('revid1', tree.inventory.root.revision)
897
816
 
898
 
    def test_install_revisions(self):
899
 
        self.tree1 = self.make_branch_and_tree('b1')
900
 
        self.b1 = self.tree1.branch
901
 
        self.tree1.commit('message', rev_id='rev2a')
902
 
        bundle = self.get_valid_bundle('null:', 'rev2a')
903
 
        branch2 = self.make_branch('b2')
904
 
        self.assertFalse(branch2.repository.has_revision('rev2a'))
905
 
        target_revision = bundle.install_revisions(branch2.repository)
906
 
        self.assertTrue(branch2.repository.has_revision('rev2a'))
907
 
        self.assertEqual('rev2a', target_revision)
908
 
 
909
 
    def test_bundle_empty_property(self):
910
 
        """Test serializing revision properties with an empty value."""
911
 
        tree = self.make_branch_and_memory_tree('tree')
912
 
        tree.lock_write()
913
 
        self.addCleanup(tree.unlock)
914
 
        tree.add([''], ['TREE_ROOT'])
915
 
        tree.commit('One', revprops={'one':'two', 'empty':''}, rev_id='rev1')
916
 
        self.b1 = tree.branch
917
 
        bundle_sio, revision_ids = self.create_bundle_text('null:', 'rev1')
918
 
        self.assertContainsRe(bundle_sio.getvalue(),
919
 
                              '# properties:\n'
920
 
                              '#   branch-nick: tree\n'
921
 
                              '#   empty: \n'
922
 
                              '#   one: two\n'
923
 
                             )
924
 
        bundle = read_bundle(bundle_sio)
925
 
        revision_info = bundle.revisions[0]
926
 
        self.assertEqual('rev1', revision_info.revision_id)
927
 
        rev = revision_info.as_revision()
928
 
        self.assertEqual({'branch-nick':'tree', 'empty':'', 'one':'two'},
929
 
                         rev.properties)
930
 
 
931
 
    def test_bundle_empty_property_alt(self):
932
 
        """Test serializing revision properties with an empty value.
933
 
 
934
 
        Older readers had a bug when reading an empty property.
935
 
        They assumed that all keys ended in ': \n'. However they would write an
936
 
        empty value as ':\n'. This tests make sure that all newer bzr versions
937
 
        can handle th second form.
938
 
        """
939
 
        tree = self.make_branch_and_memory_tree('tree')
940
 
        tree.lock_write()
941
 
        self.addCleanup(tree.unlock)
942
 
        tree.add([''], ['TREE_ROOT'])
943
 
        tree.commit('One', revprops={'one':'two', 'empty':''}, rev_id='rev1')
944
 
        self.b1 = tree.branch
945
 
        bundle_sio, revision_ids = self.create_bundle_text('null:', 'rev1')
946
 
        txt = bundle_sio.getvalue()
947
 
        loc = txt.find('#   empty: ') + len('#   empty:')
948
 
        # Create a new bundle, which strips the trailing space after empty
949
 
        bundle_sio = StringIO(txt[:loc] + txt[loc+1:])
950
 
 
951
 
        self.assertContainsRe(bundle_sio.getvalue(),
952
 
                              '# properties:\n'
953
 
                              '#   branch-nick: tree\n'
954
 
                              '#   empty:\n'
955
 
                              '#   one: two\n'
956
 
                             )
957
 
        bundle = read_bundle(bundle_sio)
958
 
        revision_info = bundle.revisions[0]
959
 
        self.assertEqual('rev1', revision_info.revision_id)
960
 
        rev = revision_info.as_revision()
961
 
        self.assertEqual({'branch-nick':'tree', 'empty':'', 'one':'two'},
962
 
                         rev.properties)
963
 
 
964
 
    def test_bundle_sorted_properties(self):
965
 
        """For stability the writer should write properties in sorted order."""
966
 
        tree = self.make_branch_and_memory_tree('tree')
967
 
        tree.lock_write()
968
 
        self.addCleanup(tree.unlock)
969
 
 
970
 
        tree.add([''], ['TREE_ROOT'])
971
 
        tree.commit('One', rev_id='rev1',
972
 
                    revprops={'a':'4', 'b':'3', 'c':'2', 'd':'1'})
973
 
        self.b1 = tree.branch
974
 
        bundle_sio, revision_ids = self.create_bundle_text('null:', 'rev1')
975
 
        self.assertContainsRe(bundle_sio.getvalue(),
976
 
                              '# properties:\n'
977
 
                              '#   a: 4\n'
978
 
                              '#   b: 3\n'
979
 
                              '#   branch-nick: tree\n'
980
 
                              '#   c: 2\n'
981
 
                              '#   d: 1\n'
982
 
                             )
983
 
        bundle = read_bundle(bundle_sio)
984
 
        revision_info = bundle.revisions[0]
985
 
        self.assertEqual('rev1', revision_info.revision_id)
986
 
        rev = revision_info.as_revision()
987
 
        self.assertEqual({'branch-nick':'tree', 'a':'4', 'b':'3', 'c':'2',
988
 
                          'd':'1'}, rev.properties)
989
 
 
990
 
    def test_bundle_unicode_properties(self):
991
 
        """We should be able to round trip a non-ascii property."""
992
 
        tree = self.make_branch_and_memory_tree('tree')
993
 
        tree.lock_write()
994
 
        self.addCleanup(tree.unlock)
995
 
 
996
 
        tree.add([''], ['TREE_ROOT'])
997
 
        # Revisions themselves do not require anything about revision property
998
 
        # keys, other than that they are a basestring, and do not contain
999
 
        # whitespace.
1000
 
        # However, Testaments assert than they are str(), and thus should not
1001
 
        # be Unicode.
1002
 
        tree.commit('One', rev_id='rev1',
1003
 
                    revprops={'omega':u'\u03a9', 'alpha':u'\u03b1'})
1004
 
        self.b1 = tree.branch
1005
 
        bundle_sio, revision_ids = self.create_bundle_text('null:', 'rev1')
1006
 
        self.assertContainsRe(bundle_sio.getvalue(),
1007
 
                              '# properties:\n'
1008
 
                              '#   alpha: \xce\xb1\n'
1009
 
                              '#   branch-nick: tree\n'
1010
 
                              '#   omega: \xce\xa9\n'
1011
 
                             )
1012
 
        bundle = read_bundle(bundle_sio)
1013
 
        revision_info = bundle.revisions[0]
1014
 
        self.assertEqual('rev1', revision_info.revision_id)
1015
 
        rev = revision_info.as_revision()
1016
 
        self.assertEqual({'branch-nick':'tree', 'omega':u'\u03a9',
1017
 
                          'alpha':u'\u03b1'}, rev.properties)
1018
 
 
1019
 
 
1020
 
class V09BundleKnit2Tester(V08BundleTester):
1021
 
 
1022
 
    format = '0.9'
1023
 
 
1024
 
    def bzrdir_format(self):
1025
 
        format = bzrdir.BzrDirMetaFormat1()
1026
 
        format.repository_format = knitrepo.RepositoryFormatKnit3()
1027
 
        return format
1028
 
 
1029
 
 
1030
 
class V09BundleKnit1Tester(V08BundleTester):
1031
 
 
1032
 
    format = '0.9'
1033
 
 
1034
 
    def bzrdir_format(self):
1035
 
        format = bzrdir.BzrDirMetaFormat1()
1036
 
        format.repository_format = knitrepo.RepositoryFormatKnit1()
1037
 
        return format
1038
 
 
1039
817
 
1040
818
class MungedBundleTester(TestCaseWithTransport):
1041
819