D6145: discovery: drop some unused sets

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Sun Mar 17 15:49:06 UTC 2019


pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/discovery.py

CHANGE DETAILS

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.



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


More information about the Mercurial-devel mailing list