~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.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:
1936
1936
        seen = set(self._find_text_key_references_from_xml_inventory_lines(
1937
1937
                line_iterator).iterkeys())
1938
1938
        # Note that revision_ids are revision keys.
1939
 
        parent_maps = self.revisions.get_parent_map(revision_ids)
1940
 
        parents = set()
1941
 
        map(parents.update, parent_maps.itervalues())
1942
 
        parents.difference_update(revision_ids)
 
1939
        parent_ids = self._find_parent_ids_of_revisions(revision_ids)
1943
1940
        parent_seen = set(self._find_text_key_references_from_xml_inventory_lines(
1944
 
            self._inventory_xml_lines_for_keys(parents)))
 
1941
            self._inventory_xml_lines_for_keys(parent_ids)))
1945
1942
        new_keys = seen - parent_seen
1946
1943
        result = {}
1947
1944
        setdefault = result.setdefault
1949
1946
            setdefault(key[0], set()).add(key[-1])
1950
1947
        return result
1951
1948
 
 
1949
    def _find_parent_ids_of_revisions(self, revision_ids):
 
1950
        """Find all parent ids that are mentioned in the revision graph.
 
1951
 
 
1952
        :return: set of revisions that are parents of revision_ids which are
 
1953
            not part of revision_ids themselves
 
1954
        """
 
1955
        parent_map = self.get_parent_map(revision_ids)
 
1956
        parents = set()
 
1957
        map(parents.update, parent_map.itervalues())
 
1958
        parents.difference_update(revision_ids)
 
1959
        parents.discard(_mod_revision.NULL_REVISION)
 
1960
        return parents
 
1961
 
1952
1962
    def fileids_altered_by_revision_ids(self, revision_ids, _inv_weave=None):
1953
1963
        """Find the file ids and versions affected by revisions.
1954
1964