Mercurial > hg
changeset 10357:0d64b30b35c3
localrepo: inline single-use nested function
author | Dirkjan Ochtman <dirkjan@ochtman.nl> |
---|---|
date | Sun, 07 Feb 2010 10:01:55 +0100 |
parents | bc2414948012 |
children | d42821cd5c96 |
files | mercurial/localrepo.py |
diffstat | 1 files changed, 12 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- 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.