# HG changeset patch # User David Soria Parra # Date 2017-11-23 22:11:27 # Node ID fd8b6b183073da2822f21e01b7914caa7ba59131 # Parent fa2395db68c6d8cc374a3ab1aef9f742c0a07a2d hbisect: pass repo into hbisect.bisect Pass repo into the bisect function to get more flexibility in what we can call. This will allow us to use revsets to rewrite parts of the ancestor and children calculation in later patches. Test Plan: python run-tests.py test-bisect* Differential Revision: https://phab.mercurial-scm.org/D1497 diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -854,7 +854,7 @@ def bisect(ui, repo, rev=None, extra=Non ui.status(_('changeset %d:%s: %s\n') % (ctx, ctx, transition)) hbisect.checkstate(state) # bisect - nodes, changesets, bgood = hbisect.bisect(repo.changelog, state) + nodes, changesets, bgood = hbisect.bisect(repo, state) # update to next check node = nodes[0] mayupdate(repo, node, show_stats=False) @@ -867,7 +867,7 @@ def bisect(ui, repo, rev=None, extra=Non hbisect.checkstate(state) # actually bisect - nodes, changesets, good = hbisect.bisect(repo.changelog, state) + nodes, changesets, good = hbisect.bisect(repo, state) if extend: if not changesets: extendnode = hbisect.extendrange(repo, state, nodes, good) diff --git a/mercurial/hbisect.py b/mercurial/hbisect.py --- a/mercurial/hbisect.py +++ b/mercurial/hbisect.py @@ -21,7 +21,7 @@ from . import ( error, ) -def bisect(changelog, state): +def bisect(repo, state): """find the next node (if any) for testing during a bisect search. returns a (nodes, number, good) tuple. @@ -32,6 +32,7 @@ def bisect(changelog, state): if searching for a first bad one. """ + changelog = repo.changelog clparents = changelog.parentrevs skip = set([changelog.rev(n) for n in state['skip']])