~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 04:54:12 UTC
  • mto: This revision was merged to the branch mainline in revision 3313.
  • Revision ID: robertc@robertcollins.net-20080327045412-rju4uoh3glidd2px
 * ``VersionedFile.get_graph_with_ghosts`` is deprecated, with no
   replacement method.  The method was size(history) and not desirable.
   (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
757
757
            annotated_part = "plain"
758
758
        return "knit-%s" % (annotated_part,)
759
759
        
 
760
    @deprecated_method(one_four)
760
761
    def get_graph_with_ghosts(self):
761
762
        """See VersionedFile.get_graph_with_ghosts()."""
762
 
        graph_items = self._index.get_graph()
763
 
        return dict(graph_items)
 
763
        return self.get_parent_map(self.versions())
764
764
 
765
765
    def get_sha1(self, version_id):
766
766
        return self.get_sha1s([version_id])[0]
1433
1433
                self._transport.put_bytes_non_atomic(
1434
1434
                    self._filename, self.HEADER, mode=self._file_mode)
1435
1435
 
1436
 
    def get_graph(self):
1437
 
        """Return a list of the node:parents lists from this knit index."""
1438
 
        return [(vid, idx[4]) for vid, idx in self._cache.iteritems()]
1439
 
 
1440
1436
    def get_ancestry(self, versions, topo_sorted=True):
1441
1437
        """See VersionedFile.get_ancestry."""
1442
1438
        # get a graph of all the mentioned versions:
1854
1850
        else:
1855
1851
            return 'fulltext'
1856
1852
 
1857
 
    def get_graph(self):
1858
 
        """Return a list of the node:parents lists from this knit index."""
1859
 
        if not self._parents:
1860
 
            return [(key, ()) for key in self.get_versions()]
1861
 
        result = []
1862
 
        for index, key, value, refs in self._graph_index.iter_all_entries():
1863
 
            result.append((key[0], tuple([ref[0] for ref in refs[0]])))
1864
 
        return result
1865
 
 
1866
1853
    def iter_parents(self, version_ids):
1867
1854
        """Iterate through the parents for many version ids.
1868
1855