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