mercurial/hbisect.py
changeset 16834 cafd8a8fb713
parent 16803 107a3270a24a
child 17424 e7cfe3587ea4
child 17493 d057e92dadfc
equal deleted inserted replaced
16833:7b460b49bf7b 16834:cafd8a8fb713
     9 # GNU General Public License version 2 or any later version.
     9 # GNU General Public License version 2 or any later version.
    10 
    10 
    11 import os, error
    11 import os, error
    12 from i18n import _
    12 from i18n import _
    13 from node import short, hex
    13 from node import short, hex
    14 import collections, util
    14 import util
    15 
    15 
    16 def bisect(changelog, state):
    16 def bisect(changelog, state):
    17     """find the next node (if any) for testing during a bisect search.
    17     """find the next node (if any) for testing during a bisect search.
    18     returns a (nodes, number, good) tuple.
    18     returns a (nodes, number, good) tuple.
    19 
    19 
    67         raise util.Abort(_("inconsistent state, %s:%s is good and bad")
    67         raise util.Abort(_("inconsistent state, %s:%s is good and bad")
    68                          % (badrev, short(bad)))
    68                          % (badrev, short(bad)))
    69 
    69 
    70     # build children dict
    70     # build children dict
    71     children = {}
    71     children = {}
    72     visit = collections.deque([badrev])
    72     visit = util.deque([badrev])
    73     candidates = []
    73     candidates = []
    74     while visit:
    74     while visit:
    75         rev = visit.popleft()
    75         rev = visit.popleft()
    76         if ancestors[rev] == []:
    76         if ancestors[rev] == []:
    77             candidates.append(rev)
    77             candidates.append(rev)