Show More
@@ -339,6 +339,8 b' def bisect(ui, repo, rev=None, extra=Non' | |||||
339 |
|
339 | |||
340 | if command: |
|
340 | if command: | |
341 | commandpath = util.find_exe(command) |
|
341 | commandpath = util.find_exe(command) | |
|
342 | if commandpath is None: | |||
|
343 | raise util.Abort(_("cannot find executable: %s") % command) | |||
342 | changesets = 1 |
|
344 | changesets = 1 | |
343 | try: |
|
345 | try: | |
344 | while changesets: |
|
346 | while changesets: | |
@@ -355,9 +357,9 b' def bisect(ui, repo, rev=None, extra=Non' | |||||
355 | raise util.Abort(_("%s killed") % command) |
|
357 | raise util.Abort(_("%s killed") % command) | |
356 | else: |
|
358 | else: | |
357 | transition = "bad" |
|
359 | transition = "bad" | |
358 |
|
|
360 | ctx = repo[rev or '.'] | |
359 | state[transition].append(node) |
|
361 | state[transition].append(ctx.node()) | |
360 |
ui. |
|
362 | ui.status(_('Changeset %d:%s: %s\n') % (ctx, ctx, transition)) | |
361 | check_state(state, interactive=False) |
|
363 | check_state(state, interactive=False) | |
362 | # bisect |
|
364 | # bisect | |
363 | nodes, changesets, good = hbisect.bisect(repo.changelog, state) |
|
365 | nodes, changesets, good = hbisect.bisect(repo.changelog, state) |
@@ -473,7 +473,7 b' class dirstate(object):' | |||||
473 |
|
473 | |||
474 | # step 1: find all explicit files |
|
474 | # step 1: find all explicit files | |
475 | for ff in sorted(files): |
|
475 | for ff in sorted(files): | |
476 |
nf = normalize(normpath(ff), |
|
476 | nf = normalize(normpath(ff), False) | |
477 | if nf in results: |
|
477 | if nf in results: | |
478 | continue |
|
478 | continue | |
479 |
|
479 |
@@ -82,3 +82,25 b' hg bisect -s' | |||||
82 | hg bisect -s |
|
82 | hg bisect -s | |
83 | hg bisect -s |
|
83 | hg bisect -s | |
84 | hg bisect -g |
|
84 | hg bisect -g | |
|
85 | ||||
|
86 | set +e | |||
|
87 | ||||
|
88 | echo % test invalid command | |||
|
89 | hg bisect -r | |||
|
90 | hg bisect --command 'foobar' | |||
|
91 | ||||
|
92 | echo % test bisecting command | |||
|
93 | cat > script.py <<EOF | |||
|
94 | #!/usr/bin/env python | |||
|
95 | import sys | |||
|
96 | from mercurial import ui, hg | |||
|
97 | repo = hg.repository(ui.ui(), '.') | |||
|
98 | if repo['.'].rev() < 6: | |||
|
99 | sys.exit(1) | |||
|
100 | EOF | |||
|
101 | chmod +x script.py | |||
|
102 | hg bisect -r | |||
|
103 | hg bisect --good tip | |||
|
104 | hg bisect --bad 0 | |||
|
105 | hg bisect --command "`pwd`/script.py" | |||
|
106 | true |
@@ -303,3 +303,19 b' user: test' | |||||
303 | date: Thu Jan 01 00:00:06 1970 +0000 |
|
303 | date: Thu Jan 01 00:00:06 1970 +0000 | |
304 | summary: msg 6 |
|
304 | summary: msg 6 | |
305 |
|
305 | |||
|
306 | % test invalid command | |||
|
307 | abort: cannot find executable: foobar | |||
|
308 | % test bisecting command | |||
|
309 | Testing changeset 15:e7fa0811edb0 (31 changesets remaining, ~4 tests) | |||
|
310 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
311 | Changeset 15:e7fa0811edb0: good | |||
|
312 | Changeset 7:03750880c6b5: good | |||
|
313 | Changeset 3:b53bea5e2fcb: bad | |||
|
314 | Changeset 5:7874a09ea728: bad | |||
|
315 | Changeset 6:a3d5c6fdf0d3: good | |||
|
316 | The first good revision is: | |||
|
317 | changeset: 6:a3d5c6fdf0d3 | |||
|
318 | user: test | |||
|
319 | date: Thu Jan 01 00:00:06 1970 +0000 | |||
|
320 | summary: msg 6 | |||
|
321 |
General Comments 0
You need to be logged in to leave comments.
Login now