# HG changeset patch # User Martin Geisler # Date 1246790620 -7200 # Node ID 93fe89afc6119ca26d0102a44d46659921cb3a06 # Parent a232b90ffb5110aeae75ff7ebf1a530ce8999bfd localrepo: removed unnecessary revkey sort helper diff -r a232b90ffb51 -r 93fe89afc611 mercurial/localrepo.py --- a/mercurial/localrepo.py Sun Jul 05 11:06:41 2009 +0200 +++ b/mercurial/localrepo.py Sun Jul 05 12:43:40 2009 +0200 @@ -1707,24 +1707,13 @@ def identity(x): return x - # A function generating function. Sets up an environment for the - # inner function. - def revkey(revlog): - # Key to sort a node by it's revision number in the environment's - # revision history. Since the revision number both represents the - # most efficient order to read the nodes in, and represents a - # topological sorting of the nodes, this function is often useful. - def revlog_sort_key(x): - return revlog.rev(x) - return revlog_sort_key - # If we determine that a particular file or manifest node must be a # node that the recipient of the changegroup will already have, we can # also assume the recipient will have all the parents. This function # prunes them from the set of missing nodes. def prune_parents(revlog, hasset, msngset): haslst = list(hasset) - haslst.sort(key=revkey(revlog)) + haslst.sort(key=revlog.rev) for node in haslst: parentlst = [p for p in revlog.parents(node) if p != nullid] while parentlst: @@ -1874,7 +1863,7 @@ add_extra_nodes(1, msng_mnfst_set) msng_mnfst_lst = msng_mnfst_set.keys() # Sort the manifestnodes by revision number. - msng_mnfst_lst.sort(key=revkey(mnfst)) + msng_mnfst_lst.sort(key=mnfst.rev) # Create a generator for the manifestnodes that calls our lookup # and data collection functions back. group = mnfst.group(msng_mnfst_lst, lookup_manifest_link, @@ -1912,7 +1901,7 @@ yield changegroup.chunkheader(len(fname)) yield fname # Sort the filenodes by their revision # - msng_filenode_lst.sort(key=revkey(filerevlog)) + msng_filenode_lst.sort(key=filerevlog.rev) # Create a group generator and only pass in a changenode # lookup function as we need to collect no information # from filenodes.