~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/_known_graph_py.py

  • Committer: Martin Pool
  • Date: 2009-09-15 01:52:34 UTC
  • mfrom: (4685 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4689.
  • Revision ID: mbp@sourcefrog.net-20090915015234-lbvl4euj2z353zjl
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
281
281
                 in tsort.merge_sort(as_parent_map, tip_key,
282
282
                                     mainline_revisions=None,
283
283
                                     generate_revno=True)]
 
284
    
 
285
    def get_parent_keys(self, key):
 
286
        """Get the parents for a key
 
287
        
 
288
        Returns a list containg the parents keys. If the key is a ghost,
 
289
        None is returned. A KeyError will be raised if the key is not in
 
290
        the graph.
 
291
        
 
292
        :param keys: Key to check (eg revision_id)
 
293
        :return: A list of parents
 
294
        """
 
295
        return self._nodes[key].parent_keys
 
296
 
 
297
    def get_child_keys(self, key):
 
298
        """Get the children for a key
 
299
        
 
300
        Returns a list containg the children keys. A KeyError will be raised
 
301
        if the key is not in the graph.
 
302
        
 
303
        :param keys: Key to check (eg revision_id)
 
304
        :return: A list of children
 
305
        """
 
306
        return self._nodes[key].child_keys