~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/graph.py

Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
from bzrlib import (
18
18
    errors,
 
19
    revision,
19
20
    tsort,
20
21
    )
21
22
from bzrlib.deprecated_graph import (node_distances, select_farthest)
22
 
from bzrlib.revision import NULL_REVISION
23
23
 
24
24
# DIAGRAM of terminology
25
25
#       A
242
242
            order if they need it.
243
243
        """
244
244
        candidate_heads = set(keys)
 
245
        if revision.NULL_REVISION in candidate_heads:
 
246
            # NULL_REVISION is only a head if it is the only entry
 
247
            candidate_heads.remove(revision.NULL_REVISION)
 
248
            if not candidate_heads:
 
249
                return set([revision.NULL_REVISION])
245
250
        if len(candidate_heads) < 2:
246
251
            return candidate_heads
247
252
        searchers = dict((c, self._make_breadth_first_searcher([c]))