/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/_known_graph_py.py

  • Committer: Gary van der Merwe
  • Date: 2009-08-25 20:46:27 UTC
  • mto: (4676.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 4677.
  • Revision ID: garyvdm@gmail.com-20090825204627-ht79so7haqloaxey
Add get_parent_keys, and get_child_keys to KnownGraph.

Show diffs side-by-side

added added

removed removed

Lines of Context:
232
232
                 in tsort.merge_sort(as_parent_map, tip_key,
233
233
                                     mainline_revisions=None,
234
234
                                     generate_revno=True)]
 
235
    
 
236
    def get_parent_keys(self, key):
 
237
        """Get the parents for a key
 
238
        
 
239
        Returns a list containg the parents keys. If the key is a ghost,
 
240
        None is returned. A KeyError will be raised if the key is not in
 
241
        the graph.
 
242
        
 
243
        :param keys: Key to check (eg revision_id)
 
244
        :return: A list of parents
 
245
        """
 
246
        return self._nodes[key].parent_keys
 
247
 
 
248
    def get_child_keys(self, key):
 
249
        """Get the children for a key
 
250
        
 
251
        Returns a list containg the children keys. A KeyError will be raised
 
252
        if the key is not in the graph.
 
253
        
 
254
        :param keys: Key to check (eg revision_id)
 
255
        :return: A list of children
 
256
        """
 
257
        return self._nodes[key].child_keys