# HG changeset patch # User Dirkjan Ochtman # Date 1265533315 -3600 # Node ID 0d64b30b35c308416aeb663359e8b0617f8382b0 # Parent bc24149480125d404a59d1a776997ffac80208cd localrepo: inline single-use nested function diff -r bc2414948012 -r 0d64b30b35c3 mercurial/localrepo.py --- a/mercurial/localrepo.py Sun Feb 07 09:58:41 2010 +0100 +++ b/mercurial/localrepo.py Sun Feb 07 10:01:55 2010 +0100 @@ -1716,20 +1716,6 @@ for r in revlog.ancestors(*[revlog.rev(n) for n in hasset]): msngset.pop(revlog.node(r), None) - # Figure out which manifest nodes (of the ones we think might be part - # of the changegroup) the recipient must know about and remove them - # from the changegroup. - def prune_manifests(): - has_mnfst_set = set() - for n in msng_mnfst_set: - # If a 'missing' manifest thinks it belongs to a changenode - # the recipient is assumed to have, obviously the recipient - # must have that manifest. - linknode = cl.node(mnfst.linkrev(mnfst.rev(n))) - if linknode in has_cl_set: - has_mnfst_set.add(n) - prune_parents(mnfst, has_mnfst_set, msng_mnfst_set) - # Use the information collected in collect_manifests_and_files to say # which changenode any manifestnode belongs to. def lookup_manifest_link(mnfstnode): @@ -1824,9 +1810,18 @@ for chnk in group: yield chnk - # The list of manifests has been collected by the generator - # calling our functions back. - prune_manifests() + # Figure out which manifest nodes (of the ones we think might be + # part of the changegroup) the recipient must know about and + # remove them from the changegroup. + has_mnfst_set = set() + for n in msng_mnfst_set: + # If a 'missing' manifest thinks it belongs to a changenode + # the recipient is assumed to have, obviously the recipient + # must have that manifest. + linknode = cl.node(mnfst.linkrev(mnfst.rev(n))) + if linknode in has_cl_set: + has_mnfst_set.add(n) + prune_parents(mnfst, has_mnfst_set, msng_mnfst_set) add_extra_nodes(1, msng_mnfst_set) msng_mnfst_lst = msng_mnfst_set.keys() # Sort the manifestnodes by revision number.