changeset 30128:e37ee8367ab4

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.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Wed, 24 Aug 2016 05:06:21 +0200
parents 1ee65f1a11a5
children d69d86e7d6c8
files mercurial/commands.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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