~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/deprecated_graph.py

  • Committer: John Arbash Meinel
  • Date: 2007-06-28 23:18:09 UTC
  • mfrom: (2562 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2566.
  • Revision ID: john@arbash-meinel.com-20070628231809-pqbt7puoqj8bl07b
[merge] bzr.dev 2562

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):