# HG changeset patch # User Pierre-Yves David # Date 1400801236 25200 # Node ID e303b8ea84b3f93b5b9e9d09eedb2a37f701c308 # Parent 7bcf4adadd2d84923bceda515704a3396eccfc66 exchange: drop dead code This code have been factorised and moved in its own function by 7d0bbb6dd730. We actually read the result of this other computation in the very line before the deleted block. I somehow forgot to remove the original code, but it is now dead. Good bye duplicated computation. diff -r 7bcf4adadd2d -r e303b8ea84b3 mercurial/exchange.py --- a/mercurial/exchange.py Thu May 22 13:39:55 2014 -0700 +++ b/mercurial/exchange.py Thu May 22 16:27:16 2014 -0700 @@ -330,37 +330,6 @@ """synchronise phase information locally and remotely""" unfi = pushop.repo.unfiltered() cheads = pushop.commonheads - if pushop.ret: - # push succeed, synchronize target of the push - cheads = pushop.outgoing.missingheads - elif pushop.revs is None: - # All out push fails. synchronize all common - cheads = pushop.outgoing.commonheads - else: - # I want cheads = heads(::missingheads and ::commonheads) - # (missingheads is revs with secret changeset filtered out) - # - # This can be expressed as: - # cheads = ( (missingheads and ::commonheads) - # + (commonheads and ::missingheads))" - # ) - # - # while trying to push we already computed the following: - # common = (::commonheads) - # missing = ((commonheads::missingheads) - commonheads) - # - # We can pick: - # * missingheads part of common (::commonheads) - common = set(pushop.outgoing.common) - nm = pushop.repo.changelog.nodemap - cheads = [node for node in pushop.revs if nm[node] in common] - # and - # * commonheads parents on missing - revset = unfi.set('%ln and parents(roots(%ln))', - pushop.outgoing.commonheads, - pushop.outgoing.missing) - cheads.extend(c.node() for c in revset) - pushop.commonheads = cheads # even when we don't push, exchanging phase data is useful remotephases = pushop.remote.listkeys('phases') if (pushop.ui.configbool('ui', '_usedassubrepo', False)