/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/bzrdir_implementations/test_bzrdir.py

Merge from bzr.dev.  Breaks a few tests because there are new methods not yet implemented.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2007 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
51
51
from bzrlib.trace import mutter
52
52
from bzrlib.transport import get_transport
53
53
from bzrlib.upgrade import upgrade
 
54
from bzrlib.repofmt import weaverepo
54
55
 
55
56
 
56
57
class TestCaseWithBzrDir(TestCaseWithTransport):
96
97
        directories = ['.']
97
98
        while directories:
98
99
            dir = directories.pop()
99
 
            for path in source.list_dir(dir):
 
100
            for path in set(source.list_dir(dir) + target.list_dir(dir)):
100
101
                path = dir + '/' + path
101
102
                if path in ignore_list:
102
103
                    continue
103
 
                stat = source.stat(path)
 
104
                try:
 
105
                    stat = source.stat(path)
 
106
                except errors.NoSuchFile:
 
107
                    self.fail('%s not in source' % path)
104
108
                if S_ISDIR(stat.st_mode):
105
109
                    self.assertTrue(S_ISDIR(target.stat(path).st_mode))
106
110
                    directories.append(path)
180
184
        dir = self.make_bzrdir('source')
181
185
        target = dir.clone(self.get_url('target'))
182
186
        self.assertNotEqual(dir.transport.base, target.transport.base)
183
 
        self.assertDirectoriesEqual(dir.root_transport, target.root_transport)
 
187
        self.assertDirectoriesEqual(dir.root_transport, target.root_transport,
 
188
                                    ['./.bzr/merge-hashes'])
184
189
    
185
190
    def test_clone_bzrdir_empty_force_new_ignored(self):
186
191
        # the force_new_repo parameter should have no effect on an empty
188
193
        dir = self.make_bzrdir('source')
189
194
        target = dir.clone(self.get_url('target'), force_new_repo=True)
190
195
        self.assertNotEqual(dir.transport.base, target.transport.base)
191
 
        self.assertDirectoriesEqual(dir.root_transport, target.root_transport)
 
196
        self.assertDirectoriesEqual(dir.root_transport, target.root_transport,
 
197
                                    ['./.bzr/merge-hashes'])
192
198
    
193
199
    def test_clone_bzrdir_repository(self):
194
200
        tree = self.make_branch_and_tree('commit_tree')
202
208
        target = dir.clone(self.get_url('target'))
203
209
        self.assertNotEqual(dir.transport.base, target.transport.base)
204
210
        self.assertDirectoriesEqual(dir.root_transport, target.root_transport,
205
 
                                    ['./.bzr/repository/inventory.knit',
 
211
                                    [
 
212
                                     './.bzr/merge-hashes',
 
213
                                     './.bzr/repository/inventory.knit',
206
214
                                     ])
207
215
 
208
216
 
318
326
        target = dir.clone(self.get_url('target'))
319
327
        self.assertNotEqual(dir.transport.base, target.transport.base)
320
328
        self.assertDirectoriesEqual(dir.root_transport, target.root_transport,
321
 
                                    ['./.bzr/stat-cache',
 
329
                                    [
 
330
                                     './.bzr/basis-inventory-cache',
322
331
                                     './.bzr/checkout/stat-cache',
 
332
                                     './.bzr/merge-hashes',
323
333
                                     './.bzr/repository/inventory.knit',
324
 
                                     ])
 
334
                                     './.bzr/stat-cache',
 
335
                                    ])
325
336
 
326
337
    def test_clone_bzrdir_branch_and_repo_into_shared_repo(self):
327
338
        # by default cloning into a shared repo uses the shared repo.
409
420
        self.assertDirectoriesEqual(dir.root_transport, target.root_transport,
410
421
                                    ['./.bzr/stat-cache',
411
422
                                     './.bzr/checkout/stat-cache',
 
423
                                     './.bzr/checkout/merge-hashes',
 
424
                                     './.bzr/merge-hashes',
412
425
                                     './.bzr/repository/inventory.knit',
413
426
                                     ])
414
427
 
425
438
        self.assertDirectoriesEqual(dir.root_transport, target.root_transport,
426
439
                                    ['./.bzr/stat-cache',
427
440
                                     './.bzr/checkout/stat-cache',
 
441
                                     './.bzr/checkout/merge-hashes',
 
442
                                     './.bzr/merge-hashes',
428
443
                                     './.bzr/repository/inventory.knit',
429
444
                                     ])
430
445
 
432
447
        self.assertDirectoriesEqual(dir.root_transport, target.root_transport,
433
448
                                    ['./.bzr/stat-cache',
434
449
                                     './.bzr/checkout/stat-cache',
 
450
                                     './.bzr/checkout/merge-hashes',
 
451
                                     './.bzr/merge-hashes',
435
452
                                     './.bzr/repository/inventory.knit',
436
453
                                     ])
437
454
 
454
471
        self.assertDirectoriesEqual(dir.root_transport, target.root_transport,
455
472
                                    ['./.bzr/stat-cache',
456
473
                                     './.bzr/checkout/stat-cache',
 
474
                                     './.bzr/checkout/merge-hashes',
 
475
                                     './.bzr/merge-hashes',
457
476
                                     './.bzr/repository/inventory.knit',
458
477
                                     ])
459
478
 
575
594
        self.assertNotEqual(dir.transport.base, target.transport.base)
576
595
        # testing inventory isn't reasonable for repositories
577
596
        self.assertDirectoriesEqual(dir.root_transport, target.root_transport,
578
 
                                    ['./.bzr/repository/inventory.knit',
579
 
                                     './.bzr/inventory'
 
597
                                    [
 
598
                                     './.bzr/branch',
 
599
                                     './.bzr/checkout',
 
600
                                     './.bzr/inventory',
 
601
                                     './.bzr/parent',
 
602
                                     './.bzr/repository/inventory.knit',
580
603
                                     ])
581
604
        try:
582
605
            # If we happen to have a tree, we'll guarantee everything
705
728
        target = self.sproutOrSkip(dir, self.get_url('target'))
706
729
        self.assertNotEqual(dir.transport.base, target.transport.base)
707
730
        self.assertDirectoriesEqual(dir.root_transport, target.root_transport,
708
 
                                    ['./.bzr/stat-cache',
 
731
                                    [
 
732
                                     './.bzr/basis-inventory-cache',
 
733
                                     './.bzr/branch/branch.conf',
 
734
                                     './.bzr/branch/parent',
 
735
                                     './.bzr/checkout',
 
736
                                     './.bzr/checkout/inventory',
709
737
                                     './.bzr/checkout/stat-cache',
710
738
                                     './.bzr/inventory',
711
 
                                     './.bzr/checkout/inventory',
 
739
                                     './.bzr/parent',
712
740
                                     './.bzr/repository/inventory.knit',
 
741
                                     './.bzr/stat-cache',
 
742
                                     './foo',
713
743
                                     ])
714
744
 
715
745
    def test_sprout_bzrdir_branch_and_repo_shared(self):
847
877
        target = self.sproutOrSkip(dir, self.get_url('target'))
848
878
        self.assertNotEqual(dir.transport.base, target.transport.base)
849
879
        self.assertDirectoriesEqual(dir.root_transport, target.root_transport,
850
 
                                    ['./.bzr/stat-cache',
 
880
                                    [
 
881
                                     './.bzr/branch/branch.conf',
 
882
                                     './.bzr/branch/parent',
851
883
                                     './.bzr/checkout/stat-cache',
 
884
                                     './.bzr/checkout/inventory',
852
885
                                     './.bzr/inventory',
853
 
                                     './.bzr/checkout/inventory',
 
886
                                     './.bzr/parent',
854
887
                                     './.bzr/repository/inventory.knit',
 
888
                                     './.bzr/stat-cache',
855
889
                                     ])
856
890
 
857
891
    def test_sprout_bzrdir_tree_branch_reference(self):
1142
1176
        self.assertTrue(isinstance(dir.get_repository_transport(None),
1143
1177
                                   transport.Transport))
1144
1178
        # with a given format, either the bzr dir supports identifiable
1145
 
        # repositoryes, or it supports anonymous  repository formats, but not both.
1146
 
        anonymous_format = repository.RepositoryFormat6()
1147
 
        identifiable_format = repository.RepositoryFormat7()
 
1179
        # repositories, or it supports anonymous  repository formats, but not both.
 
1180
        anonymous_format = weaverepo.RepositoryFormat6()
 
1181
        identifiable_format = weaverepo.RepositoryFormat7()
1148
1182
        try:
1149
1183
            found_transport = dir.get_repository_transport(anonymous_format)
1150
1184
            self.assertRaises(errors.IncompatibleFormat,