Show More
@@ -1350,11 +1350,6 b' class localrepository(repo.repository):' | |||
|
1350 | 1350 | for r in revlog.ancestors(*[revlog.rev(n) for n in hasset]): |
|
1351 | 1351 | msngset.pop(revlog.node(r), None) |
|
1352 | 1352 | |
|
1353 | # Use the information collected in changegroup.collector() to say | |
|
1354 | # which changenode any manifestnode belongs to. | |
|
1355 | def lookup_manifest_link(mnfstnode): | |
|
1356 | return msng_mnfst_set[mnfstnode] | |
|
1357 | ||
|
1358 | 1353 | # A function generating function that sets up the initial environment |
|
1359 | 1354 | # the inner function. |
|
1360 | 1355 | def filenode_collector(changedfiles): |
@@ -1400,26 +1395,16 b' class localrepository(repo.repository):' | |||
|
1400 | 1395 | |
|
1401 | 1396 | # We have a list of filenodes we think we need for a file, lets remove |
|
1402 | 1397 | # all those we know the recipient must have. |
|
1403 | def prune_filenodes(f, filerevlog): | |
|
1404 | msngset = msng_filenode_set[f] | |
|
1398 | def prune_filenodes(f, filerevlog, missingnodes): | |
|
1405 | 1399 | hasset = set() |
|
1406 | 1400 | # If a 'missing' filenode thinks it belongs to a changenode we |
|
1407 | 1401 | # assume the recipient must have, then the recipient must have |
|
1408 | 1402 | # that filenode. |
|
1409 |
for n in m |
|
|
1403 | for n in missingnodes: | |
|
1410 | 1404 | clnode = cl.node(filerevlog.linkrev(filerevlog.rev(n))) |
|
1411 | 1405 | if clnode in has_cl_set: |
|
1412 | 1406 | hasset.add(n) |
|
1413 |
prune_parents(filerevlog, hasset, m |
|
|
1414 | ||
|
1415 | # A function generator function that sets up the a context for the | |
|
1416 | # inner function. | |
|
1417 | def lookup_filenode_link_func(fname): | |
|
1418 | msngset = msng_filenode_set[fname] | |
|
1419 | # Lookup the changenode the filenode belongs to. | |
|
1420 | def lookup_filenode_link(fnode): | |
|
1421 | return msngset[fnode] | |
|
1422 | return lookup_filenode_link | |
|
1407 | prune_parents(filerevlog, hasset, missingnodes) | |
|
1423 | 1408 | |
|
1424 | 1409 | # Add the nodes that were explicitly requested. |
|
1425 | 1410 | def add_extra_nodes(name, nodes): |
@@ -1466,7 +1451,8 b' class localrepository(repo.repository):' | |||
|
1466 | 1451 | msng_mnfst_lst.sort(key=mnfst.rev) |
|
1467 | 1452 | # Create a generator for the manifestnodes that calls our lookup |
|
1468 | 1453 | # and data collection functions back. |
|
1469 |
group = mnfst.group(msng_mnfst_lst, |
|
|
1454 | group = mnfst.group(msng_mnfst_lst, | |
|
1455 | lambda mnode: msng_mnfst_set[mnode], | |
|
1470 | 1456 | filenode_collector(changedfiles)) |
|
1471 | 1457 | cnt = 0 |
|
1472 | 1458 | for chnk in group: |
@@ -1494,32 +1480,27 b' class localrepository(repo.repository):' | |||
|
1494 | 1480 | raise util.Abort(_("empty or missing revlog for %s") % fname) |
|
1495 | 1481 | # Toss out the filenodes that the recipient isn't really |
|
1496 | 1482 | # missing. |
|
1497 |
if |
|
|
1498 |
|
|
|
1499 |
|
|
|
1500 | msng_filenode_lst = msng_filenode_set[fname].keys() | |
|
1501 | else: | |
|
1502 | msng_filenode_lst = [] | |
|
1483 | missingfnodes = msng_filenode_set.pop(fname, {}) | |
|
1484 | prune_filenodes(fname, filerevlog, missingfnodes) | |
|
1485 | add_extra_nodes(fname, missingfnodes) | |
|
1503 | 1486 | # If any filenodes are left, generate the group for them, |
|
1504 | 1487 | # otherwise don't bother. |
|
1505 |
if |
|
|
1488 | if missingfnodes: | |
|
1506 | 1489 | yield changegroup.chunkheader(len(fname)) |
|
1507 | 1490 | yield fname |
|
1508 | # Sort the filenodes by their revision # | |
|
1509 | msng_filenode_lst.sort(key=filerevlog.rev) | |
|
1491 | # Sort the filenodes by their revision # (topological order) | |
|
1492 | nodeiter = list(missingfnodes) | |
|
1493 | nodeiter.sort(key=filerevlog.rev) | |
|
1510 | 1494 | # Create a group generator and only pass in a changenode |
|
1511 | 1495 | # lookup function as we need to collect no information |
|
1512 | 1496 | # from filenodes. |
|
1513 |
group = filerevlog.group( |
|
|
1514 |
l |
|
|
1497 | group = filerevlog.group(nodeiter, | |
|
1498 | lambda fnode: missingfnodes[fnode]) | |
|
1515 | 1499 | for chnk in group: |
|
1516 | 1500 | self.ui.progress( |
|
1517 | 1501 | _('bundling files'), cnt, item=fname, unit=_('chunks')) |
|
1518 | 1502 | cnt += 1 |
|
1519 | 1503 | yield chnk |
|
1520 | if fname in msng_filenode_set: | |
|
1521 | # Don't need this anymore, toss it to free memory. | |
|
1522 | del msng_filenode_set[fname] | |
|
1523 | 1504 | # Signal that no more groups are left. |
|
1524 | 1505 | yield changegroup.closechunk() |
|
1525 | 1506 | self.ui.progress(_('bundling files'), None) |
General Comments 0
You need to be logged in to leave comments.
Login now