~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/knit.py

  • Committer: Robert Collins
  • Date: 2007-07-13 18:32:36 UTC
  • mto: (2592.5.3 pack-repository)
  • mto: This revision was merged to the branch mainline in revision 2933.
  • Revision ID: robertc@robertcollins.net-20070713183236-iyluu19jnoef43qc
Implement KnitGraphIndex.has_version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1386
1386
        """Get all the versions in the file. not topologically sorted."""
1387
1387
        return [node[0] for node in self._graph_index.iter_all_entries()]
1388
1388
    
 
1389
    def has_version(self, version_id):
 
1390
        """True if the version is in the index."""
 
1391
        return len(list(self._graph_index.iter_entries([version_id]))) == 1
1389
1392
 
1390
1393
 
1391
1394
class _KnitData(_KnitComponentFile):