##// END OF EJS Templates
discovery: better coding style
Benoit Boissinot -
r11577:0bc45025 default
parent child Browse files
Show More
@@ -226,18 +226,18 b' def prepush(repo, remote, force, revs, n'
226 226 successive changegroup chunks ready to be sent over the wire and
227 227 remoteheads is the list of remote heads.'''
228 228 common = {}
229 remote_heads = remote.heads()
230 inc = findincoming(repo, remote, common, remote_heads, force=force)
229 remoteheads = remote.heads()
230 inc = findincoming(repo, remote, common, remoteheads, force=force)
231 231
232 232 cl = repo.changelog
233 update = findoutgoing(repo, remote, common, remote_heads)
233 update = findoutgoing(repo, remote, common, remoteheads)
234 234 outg, bases, heads = cl.nodesbetween(update, revs)
235 235
236 236 if not bases:
237 237 repo.ui.status(_("no changes found\n"))
238 238 return None, 1
239 239
240 if not force and remote_heads != [nullid]:
240 if not force and remoteheads != [nullid]:
241 241
242 242 def fail_multiple_heads(unsynced, branch=None):
243 243 if branch:
@@ -286,11 +286,11 b' def prepush(repo, remote, force, revs, n'
286 286 newmap = {}
287 287 unsynced = set()
288 288 for branch in branches:
289 remoteheads = remotemap[branch]
290 prunedheads = [h for h in remoteheads if h in cl.nodemap]
291 oldmap[branch] = prunedheads
292 newmap[branch] = list(prunedheads)
293 if len(remoteheads) > len(prunedheads):
289 remotebrheads = remotemap[branch]
290 prunedbrheads = [h for h in remotebrheads if h in cl.nodemap]
291 oldmap[branch] = prunedbrheads
292 newmap[branch] = list(prunedbrheads)
293 if len(remotebrheads) > len(prunedbrheads):
294 294 unsynced.add(branch)
295 295
296 296 # 4. Update newmap with outgoing changes.
@@ -312,7 +312,7 b' def prepush(repo, remote, force, revs, n'
312 312 else:
313 313 # Old servers: Check for new topological heads.
314 314 # Code based on _updatebranchcache.
315 newheads = set(h for h in remote_heads if h in cl.nodemap)
315 newheads = set(h for h in remoteheads if h in cl.nodemap)
316 316 oldheadcnt = len(newheads)
317 317 newheads.update(outg)
318 318 if len(newheads) > 1:
@@ -334,4 +334,4 b' def prepush(repo, remote, force, revs, n'
334 334 cg = repo._changegroup(nodes, 'push')
335 335 else:
336 336 cg = repo.changegroupsubset(update, revs, 'push')
337 return cg, remote_heads
337 return cg, remoteheads
General Comments 0
You need to be logged in to leave comments. Login now