~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/groupcompress_repo.py

  • Committer: John Arbash Meinel
  • Date: 2009-05-29 15:12:14 UTC
  • mto: This revision was merged to the branch mainline in revision 4460.
  • Revision ID: john@arbash-meinel.com-20090529151214-88xyma7slrvumx7a
Remove some of the code duplication.
Discover a slightly broken bit of code that was finding parent inventories 2x.

Show diffs side-by-side

added added

removed removed

Lines of Context:
737
737
        # make it raise to trap naughty direct users.
738
738
        raise NotImplementedError(self._iter_inventory_xmls)
739
739
 
740
 
    def _find_parent_ids_of_revisions(self, revision_ids):
741
 
        # TODO: we probably want to make this a helper that other code can get
742
 
        #       at
743
 
        parent_map = self.get_parent_map(revision_ids)
744
 
        parents = set()
745
 
        map(parents.update, parent_map.itervalues())
746
 
        parents.difference_update(revision_ids)
747
 
        parents.discard(_mod_revision.NULL_REVISION)
748
 
        return parents
749
 
 
750
740
    def _find_present_inventory_ids(self, revision_ids):
751
741
        keys = [(r,) for r in revision_ids]
752
742
        parent_map = self.inventories.get_parent_map(keys)
895
885
            p_id_roots_set.clear()
896
886
        return ('inventories', _filtered_inv_stream())
897
887
 
898
 
    def _find_present_inventories(self, revision_ids):
899
 
        revision_keys = [(r,) for r in revision_ids]
900
 
        inventories = self.from_repository.inventories
901
 
        present_inventories = inventories.get_parent_map(revision_keys)
902
 
        return [p[-1] for p in present_inventories]
903
 
 
904
888
    def _get_filtered_chk_streams(self, excluded_revision_ids):
905
889
        self._text_keys = set()
906
890
        excluded_revision_ids.discard(_mod_revision.NULL_REVISION)
914
898
            #       ignore_missing=True
915
899
            present_ids = self.from_repository._find_present_inventory_ids(
916
900
                            excluded_revision_ids)
917
 
            present_ids = self._find_present_inventories(excluded_revision_ids)
918
901
            uninteresting_root_keys = set()
919
902
            uninteresting_pid_root_keys = set()
920
903
            for inv in self.from_repository.iter_inventories(present_ids):