~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: 2006-04-20 08:22:24 UTC
  • mfrom: (1666.1.16 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20060420082224-da4345a35c42e545
Fix occasional test failuresin bzrdir_implementations.

Show diffs side-by-side

added added

removed removed

Lines of Context:
78
78
        """Assert that the content of source and target are identical.
79
79
 
80
80
        paths in ignore list will be completely ignored.
 
81
        
 
82
        We ignore paths that represent data which is allowed to change during
 
83
        a clone or sprout: for instance, inventory.knit contains gzip fragements
 
84
        which have timestamps in them, and as we have read the inventory from 
 
85
        the source knit, the already-read data is recompressed rather than
 
86
        reading it again, which leads to changed timestamps. This is ok though,
 
87
        because the inventory.kndx file is not ignored, and the integrity of
 
88
        knit joins is tested by test_knit and test_versionedfile.
81
89
        """
82
90
        files = []
83
91
        directories = ['.']
121
129
        self.assertTrue(repo.has_revision('1'))
122
130
        target = dir.clone(self.get_url('target'))
123
131
        self.assertNotEqual(dir.transport.base, target.transport.base)
124
 
        self.assertDirectoriesEqual(dir.root_transport, target.root_transport)
 
132
        self.assertDirectoriesEqual(dir.root_transport, target.root_transport,
 
133
                                    ['./.bzr/repository/inventory.knit',
 
134
                                     ])
 
135
 
125
136
 
126
137
    def test_clone_bzrdir_repository_under_shared(self):
127
138
        tree = self.make_branch_and_tree('commit_tree')
175
186
            return
176
187
        target = dir.clone(self.get_url('target/child'), force_new_repo=True)
177
188
        self.assertNotEqual(dir.transport.base, target.transport.base)
178
 
        self.assertDirectoriesEqual(dir.root_transport, target.root_transport)
 
189
        self.assertDirectoriesEqual(dir.root_transport, target.root_transport,
 
190
                                    ['./.bzr/repository/inventory.knit',
 
191
                                     ])
179
192
 
180
193
    def test_clone_bzrdir_repository_revision(self):
181
194
        # test for revision limiting, [smoke test, not corner case checks].
207
220
        target = dir.clone(self.get_url('target'))
208
221
        self.assertNotEqual(dir.transport.base, target.transport.base)
209
222
        self.assertDirectoriesEqual(dir.root_transport, target.root_transport,
210
 
                                    ['./.bzr/stat-cache', './.bzr/checkout/stat-cache'])
 
223
                                    ['./.bzr/stat-cache',
 
224
                                     './.bzr/checkout/stat-cache',
 
225
                                     './.bzr/repository/inventory.knit',
 
226
                                     ])
211
227
 
212
228
    def test_clone_bzrdir_branch_and_repo_into_shared_repo(self):
213
229
        # by default cloning into a shared repo uses the shared repo.
246
262
        target = dir.clone(self.get_url('target/child'), force_new_repo=True)
247
263
        self.assertNotEqual(dir.transport.base, target.transport.base)
248
264
        target.open_repository()
249
 
        self.assertDirectoriesEqual(dir.root_transport, target.root_transport)
 
265
        self.assertDirectoriesEqual(dir.root_transport, target.root_transport,
 
266
                                    ['./.bzr/repository/inventory.knit',
 
267
                                     ])
250
268
 
251
269
    def test_clone_bzrdir_branch_reference(self):
252
270
        # cloning should preserve the reference status of the branch in a bzrdir
260
278
            return
261
279
        target = dir.clone(self.get_url('target'))
262
280
        self.assertNotEqual(dir.transport.base, target.transport.base)
263
 
        self.assertDirectoriesEqual(dir.root_transport, target.root_transport)
 
281
        self.assertDirectoriesEqual(dir.root_transport, target.root_transport,
 
282
                                    ['./.bzr/repository/inventory.knit',
 
283
                                     ])
264
284
 
265
285
    def test_clone_bzrdir_branch_revision(self):
266
286
        # test for revision limiting, [smoke test, not corner case checks].
288
308
        target = dir.clone(self.get_url('target'))
289
309
        self.assertNotEqual(dir.transport.base, target.transport.base)
290
310
        self.assertDirectoriesEqual(dir.root_transport, target.root_transport,
291
 
                                    ['./.bzr/stat-cache', './.bzr/checkout/stat-cache'])
 
311
                                    ['./.bzr/stat-cache',
 
312
                                     './.bzr/checkout/stat-cache',
 
313
                                     './.bzr/repository/inventory.knit',
 
314
                                     ])
 
315
 
292
316
        target.open_workingtree().revert([])
293
317
 
294
318
    def test_revert_inventory(self):
299
323
        dir = tree.bzrdir
300
324
        target = dir.clone(self.get_url('target'))
301
325
        self.assertDirectoriesEqual(dir.root_transport, target.root_transport,
302
 
                                    ['./.bzr/stat-cache', './.bzr/checkout/stat-cache'])
 
326
                                    ['./.bzr/stat-cache',
 
327
                                     './.bzr/checkout/stat-cache',
 
328
                                     './.bzr/repository/inventory.knit',
 
329
                                     ])
 
330
 
303
331
        target.open_workingtree().revert([])
304
332
        self.assertDirectoriesEqual(dir.root_transport, target.root_transport,
305
 
                                    ['./.bzr/stat-cache', './.bzr/checkout/stat-cache'])
 
333
                                    ['./.bzr/stat-cache',
 
334
                                     './.bzr/checkout/stat-cache',
 
335
                                     './.bzr/repository/inventory.knit',
 
336
                                     ])
 
337
 
306
338
 
307
339
    def test_clone_bzrdir_tree_branch_reference(self):
308
340
        # a tree with a branch reference (aka a checkout) 
319
351
        target = dir.clone(self.get_url('target'))
320
352
        self.assertNotEqual(dir.transport.base, target.transport.base)
321
353
        self.assertDirectoriesEqual(dir.root_transport, target.root_transport,
322
 
                                    ['./.bzr/stat-cache', './.bzr/checkout/stat-cache'])
 
354
                                    ['./.bzr/stat-cache',
 
355
                                     './.bzr/checkout/stat-cache',
 
356
                                     './.bzr/repository/inventory.knit',
 
357
                                     ])
 
358
 
323
359
 
324
360
    def test_clone_bzrdir_tree_revision(self):
325
361
        # test for revision limiting, [smoke test, not corner case checks].
400
436
        self.assertTrue(repo.has_revision('1'))
401
437
        target = dir.sprout(self.get_url('target'))
402
438
        self.assertNotEqual(dir.transport.base, target.transport.base)
403
 
        self.assertDirectoriesEqual(dir.root_transport, target.root_transport)
 
439
        self.assertDirectoriesEqual(dir.root_transport, target.root_transport,
 
440
                                    ['./.bzr/repository/inventory.knit',
 
441
                                     ])
404
442
 
405
443
    def test_sprout_bzrdir_with_repository_to_shared(self):
406
444
        tree = self.make_branch_and_tree('commit_tree')
494
532
                                     './.bzr/checkout/stat-cache',
495
533
                                     './.bzr/inventory',
496
534
                                     './.bzr/checkout/inventory',
 
535
                                     './.bzr/repository/inventory.knit',
497
536
                                     ])
498
537
 
499
538
    def test_sprout_bzrdir_branch_and_repo_shared(self):
633
672
                                     './.bzr/checkout/stat-cache',
634
673
                                     './.bzr/inventory',
635
674
                                     './.bzr/checkout/inventory',
 
675
                                     './.bzr/repository/inventory.knit',
636
676
                                     ])
637
677
 
638
678
    def test_sprout_bzrdir_tree_branch_reference(self):