##// END OF EJS Templates
discovery: simplify branchmap construction against legacy server...
Pierre-Yves David -
r17056:30853f4b default
parent child Browse files
Show More
@@ -207,18 +207,16 b' def checkheads(repo, remote, outgoing, r'
207 # 1-4b. old servers: Check for new topological heads.
207 # 1-4b. old servers: Check for new topological heads.
208 # Construct {old,new}map with branch = None (topological branch).
208 # Construct {old,new}map with branch = None (topological branch).
209 # (code based on _updatebranchcache)
209 # (code based on _updatebranchcache)
210 oldheadrevs = set(cl.rev(h) for h in remoteheads if h in cl.nodemap)
210 oldheads = set(h for h in remoteheads if h in cl.nodemap)
211 missingrevs = [cl.rev(node) for node in outgoing.missing]
211 # all nodes in outgoing.missing are children of either:
212 newheadrevs = oldheadrevs.union(missingrevs)
212 # - an element of oldheads
213 if len(newheadrevs) > 1:
213 # - another element of outgoing.missing
214 for latest in sorted(missingrevs, reverse=True):
214 # - nullrev
215 if latest not in newheadrevs:
215 # This explains why the new head are very simple to compute.
216 continue
216 r = repo.set('heads(%ln + %ln)', oldheads, outgoing.missing)
217 reachable = cl.ancestors([latest], min(newheadrevs))
218 newheadrevs.difference_update(reachable)
219 branches = set([None])
217 branches = set([None])
220 newmap = {None: [cl.node(rev) for rev in newheadrevs]}
218 newmap = {None: list(c.node() for c in r)}
221 oldmap = {None: [cl.node(rev) for rev in oldheadrevs]}
219 oldmap = {None: oldheads}
222 unsynced = inc and branches or set()
220 unsynced = inc and branches or set()
223
221
224 # 5. Check for new heads.
222 # 5. Check for new heads.
General Comments 0
You need to be logged in to leave comments. Login now