##// END OF EJS Templates
discovery: prevent deleting items from a dictionary...
Pulkit Goyal -
r42195:0cc9d791 default
parent child Browse files
Show More
@@ -212,10 +212,11 b' def _headssummary(pushop):'
212 with remote.commandexecutor() as e:
212 with remote.commandexecutor() as e:
213 remotemap = e.callcommand('branchmap', {}).result()
213 remotemap = e.callcommand('branchmap', {}).result()
214
214
215 remotebranches = set(remotemap)
215 # A. register remote heads of branches which are in outgoing set
216
217 # A. register remote heads
218 for branch, heads in remotemap.iteritems():
216 for branch, heads in remotemap.iteritems():
217 # don't add head info about branches which we don't have locally
218 if branch not in branches:
219 continue
219 known = []
220 known = []
220 unsynced = []
221 unsynced = []
221 knownnode = cl.hasnode # do not use nodemap until it is filtered
222 knownnode = cl.hasnode # do not use nodemap until it is filtered
@@ -225,16 +226,13 b' def _headssummary(pushop):'
225 else:
226 else:
226 unsynced.append(h)
227 unsynced.append(h)
227 headssum[branch] = (known, list(known), unsynced)
228 headssum[branch] = (known, list(known), unsynced)
229
228 # B. add new branch data
230 # B. add new branch data
229 for branch in branches:
231 for branch in branches:
230 if branch not in headssum:
232 if branch not in headssum:
231 headssum[branch] = (None, [], [])
233 headssum[branch] = (None, [], [])
232
234
233 # C drop data about untouched branches:
235 # C. Update newmap with outgoing changes.
234 for branch in remotebranches - branches:
235 del headssum[branch]
236
237 # D. Update newmap with outgoing changes.
238 # This will possibly add new heads and remove existing ones.
236 # This will possibly add new heads and remove existing ones.
239 newmap = branchmap.remotebranchcache((branch, heads[1])
237 newmap = branchmap.remotebranchcache((branch, heads[1])
240 for branch, heads in headssum.iteritems()
238 for branch, heads in headssum.iteritems()
General Comments 0
You need to be logged in to leave comments. Login now