Patchwork [1,of,2] setdiscovery: drop shadowed 'undecided' assignment

login
register
mail settings
Submitter Pierre-Yves David
Date Jan. 7, 2015, 7:56 a.m.
Message ID <0eb961b8ee3cf1c35d63.1420617361@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/7348/
State Accepted
Commit 4ef2f2fa8b8b27daf21375017f5646b3277d35cc
Headers show

Comments

Pierre-Yves David - Jan. 7, 2015, 7:56 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1420590637 28800
#      Tue Jan 06 16:30:37 2015 -0800
# Node ID 0eb961b8ee3cf1c35d6314d05290baa220546394
# Parent  d944492445fa0d0b9c164336afab68127080a1f3
setdiscovery: drop shadowed 'undecided' assignment

The 'undecided' variable was never used before being overwritten a few lines
later.

Patch

diff --git a/mercurial/setdiscovery.py b/mercurial/setdiscovery.py
--- a/mercurial/setdiscovery.py
+++ b/mercurial/setdiscovery.py
@@ -172,18 +172,17 @@  def findcommonheads(ui, local, remote,
         ownheadhashes = dag.externalizeall(ownheads)
         return (ownheadhashes, True, srvheadhashes,)
 
     # full blown discovery
 
-    # own nodes where I don't know if remote knows them
-    undecided = dag.nodeset()
     # own nodes I know we both know
     # treat remote heads (and maybe own heads) as a first implicit sample
     # response
     common = cl.incrementalmissingrevs(srvheads)
     commoninsample = set(n for i, n in enumerate(sample) if yesno[i])
     common.addbases(commoninsample)
+    # own nodes where I don't know if remote knows them
     undecided = set(common.missingancestors(ownheads))
     # own nodes I know remote lacks
     missing = set()
 
     full = False