##// END OF EJS Templates
changegroup*(): use set instead of dict
Benoit Boissinot -
r11648:801533a5 default
parent child Browse files
Show More
@@ -61,8 +61,7 b' def collector(cl, mmfs, files):'
61 # We want to gather manifests needed and filelogs affected.
61 # We want to gather manifests needed and filelogs affected.
62 def collect(node):
62 def collect(node):
63 c = cl.read(node)
63 c = cl.read(node)
64 for fn in c[3]:
64 files.update(c[3])
65 files.setdefault(fn, fn)
66 mmfs.setdefault(c[0], node)
65 mmfs.setdefault(c[0], node)
67 return collect
66 return collect
68
67
@@ -1373,10 +1373,9 b' class localrepository(repo.repository):'
1373 deltamf = mnfst.readdelta(mnfstnode)
1373 deltamf = mnfst.readdelta(mnfstnode)
1374 # For each line in the delta
1374 # For each line in the delta
1375 for f, fnode in deltamf.iteritems():
1375 for f, fnode in deltamf.iteritems():
1376 f = changedfiles.get(f, None)
1377 # And if the file is in the list of files we care
1376 # And if the file is in the list of files we care
1378 # about.
1377 # about.
1379 if f is not None:
1378 if f in changedfiles:
1380 # Get the changenode this manifest belongs to
1379 # Get the changenode this manifest belongs to
1381 clnode = msng_mnfst_set[mnfstnode]
1380 clnode = msng_mnfst_set[mnfstnode]
1382 # Create the set of filenodes for the file if
1381 # Create the set of filenodes for the file if
@@ -1435,7 +1434,7 b' class localrepository(repo.repository):'
1435 # logically divide up the task, generate the group.
1434 # logically divide up the task, generate the group.
1436 def gengroup():
1435 def gengroup():
1437 # The set of changed files starts empty.
1436 # The set of changed files starts empty.
1438 changedfiles = {}
1437 changedfiles = set()
1439 collect = changegroup.collector(cl, msng_mnfst_set, changedfiles)
1438 collect = changegroup.collector(cl, msng_mnfst_set, changedfiles)
1440
1439
1441 # Create a changenode group generator that will call our functions
1440 # Create a changenode group generator that will call our functions
@@ -1486,7 +1485,7 b' class localrepository(repo.repository):'
1486 if isinstance(fname, int):
1485 if isinstance(fname, int):
1487 continue
1486 continue
1488 msng_filenode_set.setdefault(fname, {})
1487 msng_filenode_set.setdefault(fname, {})
1489 changedfiles[fname] = 1
1488 changedfiles.add(fname)
1490 # Go through all our files in order sorted by name.
1489 # Go through all our files in order sorted by name.
1491 cnt = 0
1490 cnt = 0
1492 for fname in sorted(changedfiles):
1491 for fname in sorted(changedfiles):
@@ -1566,7 +1565,7 b' class localrepository(repo.repository):'
1566 def gengroup():
1565 def gengroup():
1567 '''yield a sequence of changegroup chunks (strings)'''
1566 '''yield a sequence of changegroup chunks (strings)'''
1568 # construct a list of all changed files
1567 # construct a list of all changed files
1569 changedfiles = {}
1568 changedfiles = set()
1570 mmfs = {}
1569 mmfs = {}
1571 collect = changegroup.collector(cl, mmfs, changedfiles)
1570 collect = changegroup.collector(cl, mmfs, changedfiles)
1572
1571
General Comments 0
You need to be logged in to leave comments. Login now