##// END OF EJS Templates
bisect: move 'printresult' in the 'hbisect' module...
Pierre-Yves David -
r30067:6e88cd06 default
parent child Browse files
Show More
@@ -835,33 +835,6 b' def bisect(ui, repo, rev=None, extra=Non'
835 835
836 836 Returns 0 on success.
837 837 """
838 def print_result(nodes, good):
839 displayer = cmdutil.show_changeset(ui, repo, {})
840 if len(nodes) == 1:
841 # narrowed it down to a single revision
842 if good:
843 ui.write(_("The first good revision is:\n"))
844 else:
845 ui.write(_("The first bad revision is:\n"))
846 displayer.show(repo[nodes[0]])
847 extendnode = hbisect.extendrange(repo, state, nodes, good)
848 if extendnode is not None:
849 ui.write(_('Not all ancestors of this changeset have been'
850 ' checked.\nUse bisect --extend to continue the '
851 'bisection from\nthe common ancestor, %s.\n')
852 % extendnode)
853 else:
854 # multiple possible revisions
855 if good:
856 ui.write(_("Due to skipped revisions, the first "
857 "good revision could be any of:\n"))
858 else:
859 ui.write(_("Due to skipped revisions, the first "
860 "bad revision could be any of:\n"))
861 for n in nodes:
862 displayer.show(repo[n])
863 displayer.close()
864
865 838 def check_state(state, interactive=True):
866 839 if not state['good'] or not state['bad']:
867 840 if (good or bad or skip or reset) and interactive:
@@ -937,7 +910,8 b' def bisect(ui, repo, rev=None, extra=Non'
937 910 finally:
938 911 state['current'] = [node]
939 912 hbisect.save_state(repo, state)
940 print_result(nodes, bgood)
913 displayer = cmdutil.show_changeset(ui, repo, {})
914 hbisect.printresult(ui, repo, state, displayer, nodes, bgood)
941 915 return
942 916
943 917 # update state
@@ -976,7 +950,8 b' def bisect(ui, repo, rev=None, extra=Non'
976 950 raise error.Abort(_("nothing to extend"))
977 951
978 952 if changesets == 0:
979 print_result(nodes, good)
953 displayer = cmdutil.show_changeset(ui, repo, {})
954 hbisect.printresult(ui, repo, state, displayer, nodes, good)
980 955 else:
981 956 assert len(nodes) == 1 # only a single node can be tested next
982 957 node = nodes[0]
@@ -279,3 +279,29 b' def shortlabel(label):'
279 279 return label[0].upper()
280 280
281 281 return None
282
283 def printresult(ui, repo, state, displayer, nodes, good):
284 if len(nodes) == 1:
285 # narrowed it down to a single revision
286 if good:
287 ui.write(_("The first good revision is:\n"))
288 else:
289 ui.write(_("The first bad revision is:\n"))
290 displayer.show(repo[nodes[0]])
291 extendnode = extendrange(repo, state, nodes, good)
292 if extendnode is not None:
293 ui.write(_('Not all ancestors of this changeset have been'
294 ' checked.\nUse bisect --extend to continue the '
295 'bisection from\nthe common ancestor, %s.\n')
296 % extendnode)
297 else:
298 # multiple possible revisions
299 if good:
300 ui.write(_("Due to skipped revisions, the first "
301 "good revision could be any of:\n"))
302 else:
303 ui.write(_("Due to skipped revisions, the first "
304 "bad revision could be any of:\n"))
305 for n in nodes:
306 displayer.show(repo[n])
307 displayer.close()
General Comments 0
You need to be logged in to leave comments. Login now