# HG changeset patch # User Benoit Boissinot # Date 1279802077 -7200 # Node ID 801533a5279904110d87c2c3c48e7db0bfd2e68a # Parent 96d3d340f6ec74a881d52bb307316b7b7054c72a changegroup*(): use set instead of dict diff -r 96d3d340f6ec -r 801533a52799 mercurial/changegroup.py --- a/mercurial/changegroup.py Thu Jul 22 10:49:55 2010 +0200 +++ b/mercurial/changegroup.py Thu Jul 22 14:34:37 2010 +0200 @@ -61,8 +61,7 @@ # We want to gather manifests needed and filelogs affected. def collect(node): c = cl.read(node) - for fn in c[3]: - files.setdefault(fn, fn) + files.update(c[3]) mmfs.setdefault(c[0], node) return collect diff -r 96d3d340f6ec -r 801533a52799 mercurial/localrepo.py --- a/mercurial/localrepo.py Thu Jul 22 10:49:55 2010 +0200 +++ b/mercurial/localrepo.py Thu Jul 22 14:34:37 2010 +0200 @@ -1373,10 +1373,9 @@ deltamf = mnfst.readdelta(mnfstnode) # For each line in the delta for f, fnode in deltamf.iteritems(): - f = changedfiles.get(f, None) # And if the file is in the list of files we care # about. - if f is not None: + if f in changedfiles: # Get the changenode this manifest belongs to clnode = msng_mnfst_set[mnfstnode] # Create the set of filenodes for the file if @@ -1435,7 +1434,7 @@ # logically divide up the task, generate the group. def gengroup(): # The set of changed files starts empty. - changedfiles = {} + changedfiles = set() collect = changegroup.collector(cl, msng_mnfst_set, changedfiles) # Create a changenode group generator that will call our functions @@ -1486,7 +1485,7 @@ if isinstance(fname, int): continue msng_filenode_set.setdefault(fname, {}) - changedfiles[fname] = 1 + changedfiles.add(fname) # Go through all our files in order sorted by name. cnt = 0 for fname in sorted(changedfiles): @@ -1566,7 +1565,7 @@ def gengroup(): '''yield a sequence of changegroup chunks (strings)''' # construct a list of all changed files - changedfiles = {} + changedfiles = set() mmfs = {} collect = changegroup.collector(cl, mmfs, changedfiles)