comparison mercurial/hbisect.py @ 26587:56b2bcea2529

error: get Abort from 'error' instead of 'util' The home of 'Abort' is 'error' not 'util' however, a lot of code seems to be confused about that and gives all the credit to 'util' instead of the hardworking 'error'. In a spirit of equity, we break the cycle of injustice and give back to 'error' the respect it deserves. And screw that 'util' poser. For great justice.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 08 Oct 2015 12:55:45 -0700
parents f0ad094db832
children cba62f996780
comparison
equal deleted inserted replaced
26586:d51c658d3f04 26587:56b2bcea2529
18 hex, 18 hex,
19 short, 19 short,
20 ) 20 )
21 from . import ( 21 from . import (
22 error, 22 error,
23 util,
24 ) 23 )
25 24
26 def bisect(changelog, state): 25 def bisect(changelog, state):
27 """find the next node (if any) for testing during a bisect search. 26 """find the next node (if any) for testing during a bisect search.
28 returns a (nodes, number, good) tuple. 27 returns a (nodes, number, good) tuple.
72 badrev, ancestors = buildancestors(state['good'], state['bad']) 71 badrev, ancestors = buildancestors(state['good'], state['bad'])
73 bad = changelog.node(badrev) 72 bad = changelog.node(badrev)
74 if not ancestors: # now we're confused 73 if not ancestors: # now we're confused
75 if (len(state['bad']) == 1 and len(state['good']) == 1 and 74 if (len(state['bad']) == 1 and len(state['good']) == 1 and
76 state['bad'] != state['good']): 75 state['bad'] != state['good']):
77 raise util.Abort(_("starting revisions are not directly related")) 76 raise error.Abort(_("starting revisions are not directly related"))
78 raise util.Abort(_("inconsistent state, %s:%s is good and bad") 77 raise error.Abort(_("inconsistent state, %s:%s is good and bad")
79 % (badrev, short(bad))) 78 % (badrev, short(bad)))
80 79
81 # build children dict 80 # build children dict
82 children = {} 81 children = {}
83 visit = collections.deque([badrev]) 82 visit = collections.deque([badrev])
147 if os.path.exists(repo.join("bisect.state")): 146 if os.path.exists(repo.join("bisect.state")):
148 for l in repo.vfs("bisect.state"): 147 for l in repo.vfs("bisect.state"):
149 kind, node = l[:-1].split() 148 kind, node = l[:-1].split()
150 node = repo.lookup(node) 149 node = repo.lookup(node)
151 if kind not in state: 150 if kind not in state:
152 raise util.Abort(_("unknown bisect kind %s") % kind) 151 raise error.Abort(_("unknown bisect kind %s") % kind)
153 state[kind].append(node) 152 state[kind].append(node)
154 return state 153 return state
155 154
156 155
157 def save_state(repo, state): 156 def save_state(repo, state):