75 best_node = changelog.node(best_rev) |
75 best_node = changelog.node(best_rev) |
76 |
76 |
77 return (best_node, tot) |
77 return (best_node, tot) |
78 |
78 |
79 def bisect(ui, repo, rev=None, extra=None, |
79 def bisect(ui, repo, rev=None, extra=None, |
80 reset=None, good=None, bad=None, skip=None): |
80 reset=None, good=None, bad=None, skip=None, noupdate=None): |
81 """Subdivision search of changesets |
81 """Subdivision search of changesets |
82 |
82 |
83 This extension helps to find changesets which introduce problems. |
83 This extension helps to find changesets which introduce problems. |
84 To use, mark the earliest changeset you know exhibits the problem |
84 To use, mark the earliest changeset you know exhibits the problem |
85 as bad, then mark the latest changeset which is free from the problem |
85 as bad, then mark the latest changeset which is free from the problem |
158 tests, size = tests + 1, size * 2 |
158 tests, size = tests + 1, size * 2 |
159 rev = repo.changelog.rev(node) |
159 rev = repo.changelog.rev(node) |
160 ui.write(_("Testing changeset %s:%s " |
160 ui.write(_("Testing changeset %s:%s " |
161 "(%s changesets remaining, ~%s tests)\n") |
161 "(%s changesets remaining, ~%s tests)\n") |
162 % (rev, hg.short(node), changesets, tests)) |
162 % (rev, hg.short(node), changesets, tests)) |
163 cmdutil.bail_if_changed(repo) |
163 if not noupdate: |
164 return hg.clean(repo, node) |
164 cmdutil.bail_if_changed(repo) |
|
165 return hg.clean(repo, node) |
165 |
166 |
166 cmdtable = { |
167 cmdtable = { |
167 "bisect": (bisect, |
168 "bisect": (bisect, |
168 [('r', 'reset', False, _('reset bisect state')), |
169 [('r', 'reset', False, _('reset bisect state')), |
169 ('g', 'good', False, _('mark changeset good')), |
170 ('g', 'good', False, _('mark changeset good')), |
170 ('b', 'bad', False, _('mark changeset bad')), |
171 ('b', 'bad', False, _('mark changeset bad')), |
171 ('s', 'skip', False, _('skip testing changeset'))], |
172 ('s', 'skip', False, _('skip testing changeset')), |
|
173 ('U', 'noupdate', False, _('do not update to target'))], |
172 _("hg bisect [-gbsr] [REV]")) |
174 _("hg bisect [-gbsr] [REV]")) |
173 } |
175 } |