~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/deprecated_graph.py

  • Committer: Aaron Bentley
  • Date: 2007-06-21 02:33:43 UTC
  • mfrom: (2530.1.1 get_ancestry_no_topo)
  • mto: This revision was merged to the branch mainline in revision 2542.
  • Revision ID: aaron.bentley@utoronto.ca-20070621023343-3f3oy8iszatpjcui
Merge of not-sorting-ancestry branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
142
142
        """Return a dictionary of graph node:ancestor_list entries."""
143
143
        return dict(self._graph_ancestors.items())
144
144
 
145
 
    def get_ancestry(self, node_id):
 
145
    def get_ancestry(self, node_id, topo_sorted=True):
146
146
        """Return the inclusive ancestors of node_id in topological order."""
147
147
        # maybe optimise this ?
148
148
        result = {}
155
155
            for parent in parents:
156
156
                if parent not in result and parent not in pending:
157
157
                    pending.add(parent)
 
158
        if not topo_sorted:
 
159
            return result.keys()
158
160
        return topo_sort(result.items())
159
161
 
160
162
    def get_descendants(self):