/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/weave.py

  • Committer: Andrew Bennetts
  • Date: 2008-04-02 00:14:00 UTC
  • mfrom: (3324 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3756.
  • Revision ID: andrew.bennetts@canonical.com-20080402001400-r1pqse38i03dl97w
Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
248
248
 
249
249
    __contains__ = has_version
250
250
 
251
 
    def get_parents(self, version_id):
252
 
        """See VersionedFile.get_parent."""
253
 
        return map(self._idx_to_name, self._parents[self._lookup(version_id)])
 
251
    def get_parent_map(self, version_ids):
 
252
        """See VersionedFile.get_parent_map."""
 
253
        result = {}
 
254
        for version_id in version_ids:
 
255
            try:
 
256
                result[version_id] = tuple(
 
257
                    map(self._idx_to_name, self._parents[self._lookup(version_id)]))
 
258
            except RevisionNotPresent:
 
259
                pass
 
260
        return result
 
261
 
 
262
    def get_parents_with_ghosts(self, version_id):
 
263
        raise NotImplementedError(self.get_parents_with_ghosts)
254
264
 
255
265
    def _check_repeated_add(self, name, parents, text, sha1):
256
266
        """Check that a duplicated add is OK.
761
771
        version_ids = set(other.versions()).intersection(set(version_ids))
762
772
        # pull in the referenced graph.
763
773
        version_ids = other.get_ancestry(version_ids)
764
 
        pending_graph = [(version, other.get_parents(version)) for
765
 
                         version in version_ids]
 
774
        pending_parents = other.get_parent_map(version_ids)
 
775
        pending_graph = pending_parents.items()
 
776
        if len(pending_graph) != len(version_ids):
 
777
            raise RevisionNotPresent(
 
778
                set(version_ids) - set(pending_parents.keys()), self)
766
779
        for name in tsort.topo_sort(pending_graph):
767
780
            other_idx = other._name_map[name]
768
781
            # returns True if we have it, False if we need it.
770
783
                names_to_join.append((other_idx, name))
771
784
            processed += 1
772
785
 
773
 
 
774
786
        if pb and not msg:
775
787
            msg = 'weave join'
776
788