~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/deprecated_graph.py

Merge bzr.dev

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