~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/pack_repo.py

  • Committer: Jelmer Vernooij
  • Date: 2010-12-20 11:57:14 UTC
  • mto: This revision was merged to the branch mainline in revision 5577.
  • Revision ID: jelmer@samba.org-20101220115714-2ru3hfappjweeg7q
Don't use no-plugins.

Show diffs side-by-side

added added

removed removed

Lines of Context:
722
722
        :return: A Pack object, or None if nothing was copied.
723
723
        """
724
724
        # open a pack - using the same name as the last temporary file
725
 
        # - which has already been flushed, so its safe.
 
725
        # - which has already been flushed, so it's safe.
726
726
        # XXX: - duplicate code warning with start_write_group; fix before
727
727
        #      considering 'done'.
728
728
        if self._pack_collection._new_pack is not None:
1292
1292
        # reinserted, and if d3 has incorrect parents it will also be
1293
1293
        # reinserted. If we insert d3 first, d2 is present (as it was bulk
1294
1294
        # copied), so we will try to delta, but d2 is not currently able to be
1295
 
        # extracted because it's basis d1 is not present. Topologically sorting
 
1295
        # extracted because its basis d1 is not present. Topologically sorting
1296
1296
        # addresses this. The following generates a sort for all the texts that
1297
1297
        # are being inserted without having to reference the entire text key
1298
1298
        # space (we only topo sort the revisions, which is smaller).
1600
1600
        pack_operations = [[0, []]]
1601
1601
        # plan out what packs to keep, and what to reorganise
1602
1602
        while len(existing_packs):
1603
 
            # take the largest pack, and if its less than the head of the
 
1603
            # take the largest pack, and if it's less than the head of the
1604
1604
            # distribution chart we will include its contents in the new pack
1605
 
            # for that position. If its larger, we remove its size from the
 
1605
            # for that position. If it's larger, we remove its size from the
1606
1606
            # distribution chart
1607
1607
            next_pack_rev_count, next_pack = existing_packs.pop(0)
1608
1608
            if next_pack_rev_count >= pack_distribution[0]:
1643
1643
 
1644
1644
        :return: True if the disk names had not been previously read.
1645
1645
        """
1646
 
        # NB: if you see an assertion error here, its probably access against
 
1646
        # NB: if you see an assertion error here, it's probably access against
1647
1647
        # an unlocked repo. Naughty.
1648
1648
        if not self.repo.is_locked():
1649
1649
            raise errors.ObjectNotLocked(self.repo)
1946
1946
                    # disk index because the set values are the same, unless
1947
1947
                    # the only index shows up as deleted by the set difference
1948
1948
                    # - which it may. Until there is a specific test for this,
1949
 
                    # assume its broken. RBC 20071017.
 
1949
                    # assume it's broken. RBC 20071017.
1950
1950
                    self._remove_pack_from_memory(self.get_pack_by_name(name))
1951
1951
                    self._names[name] = sizes
1952
1952
                    self.get_pack_by_name(name)
2017
2017
        """
2018
2018
        # The ensure_loaded call is to handle the case where the first call
2019
2019
        # made involving the collection was to reload_pack_names, where we 
2020
 
        # don't have a view of disk contents. Its a bit of a bandaid, and
2021
 
        # causes two reads of pack-names, but its a rare corner case not struck
2022
 
        # with regular push/pull etc.
 
2020
        # don't have a view of disk contents. It's a bit of a bandaid, and
 
2021
        # causes two reads of pack-names, but it's a rare corner case not
 
2022
        # struck with regular push/pull etc.
2023
2023
        first_read = self.ensure_loaded()
2024
2024
        if first_read:
2025
2025
            return True
2894
2894
class RepositoryFormatPackDevelopment2Subtree(RepositoryFormatPack):
2895
2895
    """A subtrees development repository.
2896
2896
 
2897
 
    This format should be retained until the second release after bzr 1.7.
 
2897
    This format should be retained in 2.3, to provide an upgrade path from this
 
2898
    to RepositoryFormat2aSubtree.  It can be removed in later releases.
2898
2899
 
2899
2900
    1.6.1-subtree[as it might have been] with B+Tree indices.
2900
 
 
2901
 
    This is [now] retained until we have a CHK based subtree format in
2902
 
    development.
2903
2901
    """
2904
2902
 
2905
2903
    repository_class = KnitPackRepository
2918
2916
 
2919
2917
    def _get_matching_bzrdir(self):
2920
2918
        return bzrdir.format_registry.make_bzrdir(
2921
 
            'development-subtree')
 
2919
            'development5-subtree')
2922
2920
 
2923
2921
    def _ignore_setting_bzrdir(self, format):
2924
2922
        pass