bisect: build a displayer only once
There is multiple spot using this, building it early will help to extract more
of the logic into the bisect module.
--- a/mercurial/commands.py Wed Aug 24 05:04:46 2016 +0200
+++ b/mercurial/commands.py Wed Aug 24 05:06:21 2016 +0200
@@ -879,6 +879,8 @@
cmdutil.bailifchanged(repo)
return hg.clean(repo, node, show_stats=show_stats)
+ displayer = cmdutil.show_changeset(ui, repo, {})
+
if command:
changesets = 1
if noupdate:
@@ -921,7 +923,6 @@
finally:
state['current'] = [node]
hbisect.save_state(repo, state)
- displayer = cmdutil.show_changeset(ui, repo, {})
hbisect.printresult(ui, repo, state, displayer, nodes, bgood)
return
@@ -941,7 +942,6 @@
raise error.Abort(_("nothing to extend"))
if changesets == 0:
- displayer = cmdutil.show_changeset(ui, repo, {})
hbisect.printresult(ui, repo, state, displayer, nodes, good)
else:
assert len(nodes) == 1 # only a single node can be tested next