~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tsort.py

Merged bzr.dev r3262.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2008 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
19
19
 
20
20
 
21
21
from bzrlib import errors
 
22
import bzrlib.revision as _mod_revision
22
23
 
23
24
 
24
25
__all__ = ["topo_sort", "TopoSorter", "merge_sort", "MergeSorter"]
406
407
        self._left_subtree_pushed_stack = []
407
408
 
408
409
        # seed the search with the tip of the branch
409
 
        if branch_tip is not None:
 
410
        if (branch_tip is not None and
 
411
            branch_tip != _mod_revision.NULL_REVISION):
410
412
            parents = self._graph.pop(branch_tip)
411
413
            self._push_node(branch_tip, 0, parents)
412
414