Show More
@@ -835,20 +835,6 b' def bisect(ui, repo, rev=None, extra=Non' | |||
|
835 | 835 | |
|
836 | 836 | Returns 0 on success. |
|
837 | 837 | """ |
|
838 | def extendbisectrange(nodes, good): | |
|
839 | # bisect is incomplete when it ends on a merge node and | |
|
840 | # one of the parent was not checked. | |
|
841 | parents = repo[nodes[0]].parents() | |
|
842 | if len(parents) > 1: | |
|
843 | if good: | |
|
844 | side = state['bad'] | |
|
845 | else: | |
|
846 | side = state['good'] | |
|
847 | num = len(set(i.node() for i in parents) & set(side)) | |
|
848 | if num == 1: | |
|
849 | return parents[0].ancestor(parents[1]) | |
|
850 | return None | |
|
851 | ||
|
852 | 838 | def print_result(nodes, good): |
|
853 | 839 | displayer = cmdutil.show_changeset(ui, repo, {}) |
|
854 | 840 | if len(nodes) == 1: |
@@ -858,7 +844,7 b' def bisect(ui, repo, rev=None, extra=Non' | |||
|
858 | 844 | else: |
|
859 | 845 | ui.write(_("The first bad revision is:\n")) |
|
860 | 846 | displayer.show(repo[nodes[0]]) |
|
861 |
extendnode = |
|
|
847 | extendnode = hbisect.extendrange(repo, state, nodes, good) | |
|
862 | 848 | if extendnode is not None: |
|
863 | 849 | ui.write(_('Not all ancestors of this changeset have been' |
|
864 | 850 | ' checked.\nUse bisect --extend to continue the ' |
@@ -977,7 +963,7 b' def bisect(ui, repo, rev=None, extra=Non' | |||
|
977 | 963 | nodes, changesets, good = hbisect.bisect(repo.changelog, state) |
|
978 | 964 | if extend: |
|
979 | 965 | if not changesets: |
|
980 |
extendnode = |
|
|
966 | extendnode = hbisect.extendrange(repo, state, nodes, good) | |
|
981 | 967 | if extendnode is not None: |
|
982 | 968 | ui.write(_("Extending search to changeset %d:%s\n") |
|
983 | 969 | % (extendnode.rev(), extendnode)) |
@@ -139,6 +139,19 b' def bisect(changelog, state):' | |||
|
139 | 139 | |
|
140 | 140 | return ([best_node], tot, good) |
|
141 | 141 | |
|
142 | def extendrange(repo, state, nodes, good): | |
|
143 | # bisect is incomplete when it ends on a merge node and | |
|
144 | # one of the parent was not checked. | |
|
145 | parents = repo[nodes[0]].parents() | |
|
146 | if len(parents) > 1: | |
|
147 | if good: | |
|
148 | side = state['bad'] | |
|
149 | else: | |
|
150 | side = state['good'] | |
|
151 | num = len(set(i.node() for i in parents) & set(side)) | |
|
152 | if num == 1: | |
|
153 | return parents[0].ancestor(parents[1]) | |
|
154 | return None | |
|
142 | 155 | |
|
143 | 156 | def load_state(repo): |
|
144 | 157 | state = {'current': [], 'good': [], 'bad': [], 'skip': []} |
General Comments 0
You need to be logged in to leave comments.
Login now