Show More
@@ -104,6 +104,7 b' def push(repo, remote, force=False, revs' | |||||
104 | _pushdiscovery(pushop) |
|
104 | _pushdiscovery(pushop) | |
105 | if _pushcheckoutgoing(pushop): |
|
105 | if _pushcheckoutgoing(pushop): | |
106 | _pushchangeset(pushop) |
|
106 | _pushchangeset(pushop) | |
|
107 | _pushcomputecommonheads(pushop) | |||
107 | _pushsyncphase(pushop) |
|
108 | _pushsyncphase(pushop) | |
108 | _pushobsolete(pushop) |
|
109 | _pushobsolete(pushop) | |
109 | finally: |
|
110 | finally: | |
@@ -207,9 +208,44 b' def _pushchangeset(pushop):' | |||||
207 | pushop.ret = pushop.remote.addchangegroup(cg, 'push', |
|
208 | pushop.ret = pushop.remote.addchangegroup(cg, 'push', | |
208 | pushop.repo.url()) |
|
209 | pushop.repo.url()) | |
209 |
|
210 | |||
|
211 | def _pushcomputecommonheads(pushop): | |||
|
212 | unfi = pushop.repo.unfiltered() | |||
|
213 | if pushop.ret: | |||
|
214 | # push succeed, synchronize target of the push | |||
|
215 | cheads = pushop.outgoing.missingheads | |||
|
216 | elif pushop.revs is None: | |||
|
217 | # All out push fails. synchronize all common | |||
|
218 | cheads = pushop.outgoing.commonheads | |||
|
219 | else: | |||
|
220 | # I want cheads = heads(::missingheads and ::commonheads) | |||
|
221 | # (missingheads is revs with secret changeset filtered out) | |||
|
222 | # | |||
|
223 | # This can be expressed as: | |||
|
224 | # cheads = ( (missingheads and ::commonheads) | |||
|
225 | # + (commonheads and ::missingheads))" | |||
|
226 | # ) | |||
|
227 | # | |||
|
228 | # while trying to push we already computed the following: | |||
|
229 | # common = (::commonheads) | |||
|
230 | # missing = ((commonheads::missingheads) - commonheads) | |||
|
231 | # | |||
|
232 | # We can pick: | |||
|
233 | # * missingheads part of common (::commonheads) | |||
|
234 | common = set(pushop.outgoing.common) | |||
|
235 | nm = pushop.repo.changelog.nodemap | |||
|
236 | cheads = [node for node in pushop.revs if nm[node] in common] | |||
|
237 | # and | |||
|
238 | # * commonheads parents on missing | |||
|
239 | revset = unfi.set('%ln and parents(roots(%ln))', | |||
|
240 | pushop.outgoing.commonheads, | |||
|
241 | pushop.outgoing.missing) | |||
|
242 | cheads.extend(c.node() for c in revset) | |||
|
243 | pushop.commonheads = cheads | |||
|
244 | ||||
210 | def _pushsyncphase(pushop): |
|
245 | def _pushsyncphase(pushop): | |
211 | """synchronise phase information locally and remotly""" |
|
246 | """synchronise phase information locally and remotly""" | |
212 | unfi = pushop.repo.unfiltered() |
|
247 | unfi = pushop.repo.unfiltered() | |
|
248 | cheads = pushop.commonheads | |||
213 | if pushop.ret: |
|
249 | if pushop.ret: | |
214 | # push succeed, synchronize target of the push |
|
250 | # push succeed, synchronize target of the push | |
215 | cheads = pushop.outgoing.missingheads |
|
251 | cheads = pushop.outgoing.missingheads |
General Comments 0
You need to be logged in to leave comments.
Login now