mercurial/hbisect.py
changeset 42337 21eda240be07
parent 42057 566daffc607d
child 43076 2372284d9457
equal deleted inserted replaced
42336:604c086ddde6 42337:21eda240be07
    30     the search and 'nodes' contains the next bisect target.
    30     the search and 'nodes' contains the next bisect target.
    31     'good' is True if bisect is searching for a first good changeset, False
    31     'good' is True if bisect is searching for a first good changeset, False
    32     if searching for a first bad one.
    32     if searching for a first bad one.
    33     """
    33     """
    34 
    34 
       
    35     repo = repo.unfiltered()
    35     changelog = repo.changelog
    36     changelog = repo.changelog
    36     clparents = changelog.parentrevs
    37     clparents = changelog.parentrevs
    37     skip = {changelog.rev(n) for n in state['skip']}
    38     skip = {changelog.rev(n) for n in state['skip']}
    38 
    39 
    39     def buildancestors(bad, good):
    40     def buildancestors(bad, good):
   137 
   138 
   138 def load_state(repo):
   139 def load_state(repo):
   139     state = {'current': [], 'good': [], 'bad': [], 'skip': []}
   140     state = {'current': [], 'good': [], 'bad': [], 'skip': []}
   140     for l in repo.vfs.tryreadlines("bisect.state"):
   141     for l in repo.vfs.tryreadlines("bisect.state"):
   141         kind, node = l[:-1].split()
   142         kind, node = l[:-1].split()
   142         node = repo.lookup(node)
   143         node = repo.unfiltered().lookup(node)
   143         if kind not in state:
   144         if kind not in state:
   144             raise error.Abort(_("unknown bisect kind %s") % kind)
   145             raise error.Abort(_("unknown bisect kind %s") % kind)
   145         state[kind].append(node)
   146         state[kind].append(node)
   146     return state
   147     return state
   147 
   148 
   182     - ``ignored``            : csets ignored due to DAG topology
   183     - ``ignored``            : csets ignored due to DAG topology
   183     - ``current``            : the cset currently being bisected
   184     - ``current``            : the cset currently being bisected
   184     """
   185     """
   185     state = load_state(repo)
   186     state = load_state(repo)
   186     if status in ('good', 'bad', 'skip', 'current'):
   187     if status in ('good', 'bad', 'skip', 'current'):
   187         return map(repo.changelog.rev, state[status])
   188         return map(repo.unfiltered().changelog.rev, state[status])
   188     else:
   189     else:
   189         # In the following sets, we do *not* call 'bisect()' with more
   190         # In the following sets, we do *not* call 'bisect()' with more
   190         # than one level of recursion, because that can be very, very
   191         # than one level of recursion, because that can be very, very
   191         # time consuming. Instead, we always develop the expression as
   192         # time consuming. Instead, we always develop the expression as
   192         # much as possible.
   193         # much as possible.
   266         return _('bad (implicit)')
   267         return _('bad (implicit)')
   267 
   268 
   268     return None
   269     return None
   269 
   270 
   270 def printresult(ui, repo, state, displayer, nodes, good):
   271 def printresult(ui, repo, state, displayer, nodes, good):
       
   272     repo = repo.unfiltered()
   271     if len(nodes) == 1:
   273     if len(nodes) == 1:
   272         # narrowed it down to a single revision
   274         # narrowed it down to a single revision
   273         if good:
   275         if good:
   274             ui.write(_("The first good revision is:\n"))
   276             ui.write(_("The first good revision is:\n"))
   275         else:
   277         else: