# HG changeset patch # User Pierre-Yves David # Date 1472007981 -7200 # Node ID e37ee8367ab4c7857e36aad4e263e2871fadc962 # Parent 1ee65f1a11a50773f6e2b34a773060e9a3d45055 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. diff -r 1ee65f1a11a5 -r e37ee8367ab4 mercurial/commands.py --- 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