##// END OF EJS Templates
bisect with command: ability to skip revision or abort bisection
Alexander Solovyov -
r7228:9b72c732 default
parent child Browse files
Show More
@@ -276,9 +276,11 b' def bisect(ui, repo, rev=None, extra=Non'
276 As a shortcut, you can also use the revision argument to mark a
276 As a shortcut, you can also use the revision argument to mark a
277 revision as good or bad without checking it out first.
277 revision as good or bad without checking it out first.
278
278
279 If you supply a command it will be used for automatic bisection. Its
279 If you supply a command it will be used for automatic bisection. Its exit
280 exit status will be used as flag to mark revision as bad or good (good
280 status will be used as flag to mark revision as bad or good. In case exit
281 in case of 0 and bad in any other case).
281 status is 0 the revision is marked as good, 125 - skipped, 127 (command not
282 found) - bisection will be aborted and any other status bigger than 0 will
283 mark revision as bad.
282 """
284 """
283 def print_result(nodes, good):
285 def print_result(nodes, good):
284 displayer = cmdutil.show_changeset(ui, repo, {})
286 displayer = cmdutil.show_changeset(ui, repo, {})
@@ -328,10 +330,18 b' def bisect(ui, repo, rev=None, extra=Non'
328 if command:
330 if command:
329 changesets = 1
331 changesets = 1
330 while changesets:
332 while changesets:
331 # check state
333 # update state
332 status = bool(list(os.popen3(command)[2]))
334 status = os.spawnlp(os.P_WAIT, command)
333 node = repo.lookup(rev or '.')
335 node = repo.lookup(rev or '.')
334 transition = (status and 'bad' or 'good')
336 if status == 125:
337 transition = "skip"
338 elif status == 0:
339 transition = "good"
340 # status < 0 means process was killed
341 elif status == 127 or status < 0:
342 break
343 else:
344 transition = "bad"
335 state[transition].append(node)
345 state[transition].append(node)
336 ui.note(_('Changeset %s: %s\n') % (short(node), transition))
346 ui.note(_('Changeset %s: %s\n') % (short(node), transition))
337 check_state(state, interactive=False)
347 check_state(state, interactive=False)
General Comments 0
You need to be logged in to leave comments. Login now