~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_repository.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-11-07 14:09:48 UTC
  • mfrom: (2948.1.3 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20071107140948-l3p8njdhgwstdkri
(robertc) Clean up obsolete_packs directory automatically. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
888
888
        # there should be 9 packs:
889
889
        index = GraphIndex(trans, 'pack-names', None)
890
890
        self.assertEqual(9, len(list(index.iter_all_entries())))
 
891
        # insert some files in obsolete_packs which should be removed by pack.
 
892
        trans.put_bytes('obsolete_packs/foo', '123')
 
893
        trans.put_bytes('obsolete_packs/bar', '321')
891
894
        # committing one more should coalesce to 1 of 10.
892
895
        tree.commit('commit triggering pack')
893
896
        index = GraphIndex(trans, 'pack-names', None)
896
899
        tree = tree.bzrdir.open_workingtree()
897
900
        check_result = tree.branch.repository.check(
898
901
            [tree.branch.last_revision()])
 
902
        # We should have 50 (10x5) files in the obsolete_packs directory.
 
903
        obsolete_files = list(trans.list_dir('obsolete_packs'))
 
904
        self.assertFalse('foo' in obsolete_files)
 
905
        self.assertFalse('bar' in obsolete_files)
 
906
        self.assertEqual(50, len(obsolete_files))
899
907
        # XXX: Todo check packs obsoleted correctly - old packs and indices
900
908
        # in the obsolete_packs directory.
901
909
        large_pack_name = list(index.iter_all_entries())[0][1][0]