~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/pack_repo.py

Show diffs side-by-side

added added

removed removed

Lines of Context:
2066
2066
    def _check_new_inventories(self):
2067
2067
        """Detect missing inventories in this write group.
2068
2068
 
2069
 
        :returns: set of missing keys.  Note that not every missing key is
2070
 
            guaranteed to be reported.
 
2069
        :returns: list of strs, summarising any problems found.  If the list is
 
2070
            empty no problems were found.
2071
2071
        """
2072
2072
        # The base implementation does no checks.  GCRepositoryPackCollection
2073
2073
        # overrides this.
2074
 
        return set()
 
2074
        return []
2075
2075
        
2076
2076
    def _commit_write_group(self):
2077
2077
        all_missing = set()
2087
2087
            raise errors.BzrCheckError(
2088
2088
                "Repository %s has missing compression parent(s) %r "
2089
2089
                 % (self.repo, sorted(all_missing)))
2090
 
        all_missing = self._check_new_inventories()
2091
 
        if all_missing:
 
2090
        problems = self._check_new_inventories()
 
2091
        if problems:
 
2092
            problems_summary = '\n'.join(problems)
2092
2093
            raise errors.BzrCheckError(
2093
 
                "Repository %s missing keys for new revisions %r "
2094
 
                 % (self.repo, sorted(all_missing)))
 
2094
                "Cannot add revision(s) to repository: " + problems_summary)
2095
2095
        self._remove_pack_indices(self._new_pack)
2096
2096
        any_new_content = False
2097
2097
        if self._new_pack.data_inserted():