~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/knit.py

  • Committer: Robert Collins
  • Date: 2008-03-27 01:25:24 UTC
  • mto: This revision was merged to the branch mainline in revision 3313.
  • Revision ID: robertc@robertcollins.net-20080327012524-yfgr0lek5ckiowhn
Deprecate VersionedFile.has_ghost.

Show diffs side-by-side

added added

removed removed

Lines of Context:
108
108
    sha_string,
109
109
    sha_strings,
110
110
    )
111
 
from bzrlib.symbol_versioning import DEPRECATED_PARAMETER, deprecated_passed
 
111
from bzrlib.symbol_versioning import (
 
112
    DEPRECATED_PARAMETER,
 
113
    deprecated_method,
 
114
    deprecated_passed,
 
115
    one_four,
 
116
    )
112
117
from bzrlib.tsort import topo_sort
113
118
from bzrlib.tuned_gzip import GzipFile, bytes_to_gzip
114
119
import bzrlib.ui
771
776
        """See VersionedFile.get_suffixes()."""
772
777
        return [DATA_SUFFIX, INDEX_SUFFIX]
773
778
 
 
779
    @deprecated_method(one_four)
774
780
    def has_ghost(self, version_id):
775
781
        """True if there is a ghost reference in the file to version_id."""
776
782
        # maybe we have it
777
783
        if self.has_version(version_id):
778
784
            return False
779
785
        # optimisable if needed by memoising the _ghosts set.
780
 
        items = self._index.get_graph()
 
786
        items = self.get_parent_map(self.versions())
781
787
        for node, parents in items:
782
788
            for parent in parents:
783
 
                if parent not in self._index._cache:
784
 
                    if parent == version_id:
785
 
                        return True
 
789
                if parent == version_id and parent not in items:
 
790
                    return True
786
791
        return False
787
792
 
788
793
    def insert_data_stream(self, (format, data_list, reader_callable)):