Rev 2854: (robertc) Special case the zero-or-no-heads case for Graph.heads(). (Robert Collins) in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Mon Sep 24 22:28:14 BST 2007


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 2854
revision-id: pqm at pqm.ubuntu.com-20070924212812-g325vvenhnfktgbh
parent: pqm at pqm.ubuntu.com-20070924114153-9j0aboyxyah6sv2c
parent: robertc at robertcollins.net-20070924193404-oyg9f9fcfvyr5435
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Mon 2007-09-24 22:28:12 +0100
message:
  (robertc) Special case the zero-or-no-heads case for Graph.heads(). (Robert Collins)
modified:
  bzrlib/graph.py                graph_walker.py-20070525030359-y852guab65d4wtn0-1
    ------------------------------------------------------------
    revno: 2850.2.1
    merged: robertc at robertcollins.net-20070924193404-oyg9f9fcfvyr5435
    parent: pqm at pqm.ubuntu.com-20070923210826-t3ymvo1l68z96in1
    committer: Robert Collins <robertc at robertcollins.net>
    branch nick: graphwalker
    timestamp: Tue 2007-09-25 05:34:04 +1000
    message:
      (robertc) Special case the zero-or-no-heads case for Graph.heads(). (Robert Collins)
=== modified file 'bzrlib/graph.py'
--- a/bzrlib/graph.py	2007-09-03 22:17:20 +0000
+++ b/bzrlib/graph.py	2007-09-24 19:34:04 +0000
@@ -231,6 +231,8 @@
             order if they need it.
         """
         candidate_heads = set(keys)
+        if len(candidate_heads) < 2:
+            return candidate_heads
         searchers = dict((c, self._make_breadth_first_searcher([c]))
                           for c in candidate_heads)
         active_searchers = dict(searchers)




More information about the bazaar-commits mailing list