~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/pack_repo.py

Merge bzr.dev to resolve news conflict

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