Patchwork D6145: discovery: drop some unused sets

login
register
mail settings
Submitter phabricator
Date March 27, 2019, 7:37 p.m.
Message ID <6329cb986ff824aac6363798501bf743@localhost.localdomain>
Download mbox | patch
Permalink /patch/39403/
State Not Applicable
Headers show

Comments

phabricator - March 27, 2019, 7:37 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGd36a7da96a5a: discovery: drop some unused sets (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6145?vs=14537&id=14600

REVISION DETAIL
  https://phab.mercurial-scm.org/D6145

AFFECTED FILES
  mercurial/discovery.py

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/discovery.py b/mercurial/discovery.py
--- a/mercurial/discovery.py
+++ b/mercurial/discovery.py
@@ -208,14 +208,11 @@ 
         ctx = repo[n]
         missingctx.add(ctx)
         branches.add(ctx.branch())
-    nbranches = branches.copy()
 
     with remote.commandexecutor() as e:
         remotemap = e.callcommand('branchmap', {}).result()
 
     remotebranches = set(remotemap)
-    newbranches = branches - remotebranches
-    branches.difference_update(newbranches)
 
     # A. register remote heads
     for branch, heads in remotemap.iteritems():
@@ -229,12 +226,12 @@ 
                 unsynced.append(h)
         headssum[branch] = (known, list(known), unsynced)
     # B. add new branch data
-    for branch in nbranches:
+    for branch in branches:
         if branch not in headssum:
             headssum[branch] = (None, [], [])
 
     # C drop data about untouched branches:
-    for branch in remotebranches - nbranches:
+    for branch in remotebranches - branches:
         del headssum[branch]
 
     # D. Update newmap with outgoing changes.