mercurial/discovery.py
changeset 42027 d36a7da96a5a
parent 42026 98908e36d58a
child 42028 0cc9d7918754
equal deleted inserted replaced
42026:98908e36d58a 42027:d36a7da96a5a
   206     branches = set()
   206     branches = set()
   207     for n in outgoing.missing:
   207     for n in outgoing.missing:
   208         ctx = repo[n]
   208         ctx = repo[n]
   209         missingctx.add(ctx)
   209         missingctx.add(ctx)
   210         branches.add(ctx.branch())
   210         branches.add(ctx.branch())
   211     nbranches = branches.copy()
       
   212 
   211 
   213     with remote.commandexecutor() as e:
   212     with remote.commandexecutor() as e:
   214         remotemap = e.callcommand('branchmap', {}).result()
   213         remotemap = e.callcommand('branchmap', {}).result()
   215 
   214 
   216     remotebranches = set(remotemap)
   215     remotebranches = set(remotemap)
   217     newbranches = branches - remotebranches
       
   218     branches.difference_update(newbranches)
       
   219 
   216 
   220     # A. register remote heads
   217     # A. register remote heads
   221     for branch, heads in remotemap.iteritems():
   218     for branch, heads in remotemap.iteritems():
   222         known = []
   219         known = []
   223         unsynced = []
   220         unsynced = []
   227                 known.append(h)
   224                 known.append(h)
   228             else:
   225             else:
   229                 unsynced.append(h)
   226                 unsynced.append(h)
   230         headssum[branch] = (known, list(known), unsynced)
   227         headssum[branch] = (known, list(known), unsynced)
   231     # B. add new branch data
   228     # B. add new branch data
   232     for branch in nbranches:
   229     for branch in branches:
   233         if branch not in headssum:
   230         if branch not in headssum:
   234             headssum[branch] = (None, [], [])
   231             headssum[branch] = (None, [], [])
   235 
   232 
   236     # C drop data about untouched branches:
   233     # C drop data about untouched branches:
   237     for branch in remotebranches - nbranches:
   234     for branch in remotebranches - branches:
   238         del headssum[branch]
   235         del headssum[branch]
   239 
   236 
   240     # D. Update newmap with outgoing changes.
   237     # D. Update newmap with outgoing changes.
   241     # This will possibly add new heads and remove existing ones.
   238     # This will possibly add new heads and remove existing ones.
   242     newmap = branchmap.remotebranchcache((branch, heads[1])
   239     newmap = branchmap.remotebranchcache((branch, heads[1])