##// END OF EJS Templates
changegroup: add first logic to send file header...
Matt Mackall -
r13809:e6f79549 default
parent child Browse files
Show More
@@ -1554,25 +1554,25 b' class localrepository(repo.repository):'
1554 1554 # missing.
1555 1555 missingfnodes = fnodes.pop(fname, {})
1556 1556 prune(filerevlog, missingfnodes)
1557 # If any filenodes are left, generate the group for them,
1558 # otherwise don't bother.
1559 if missingfnodes:
1560 yield changegroup.chunkheader(len(fname))
1561 yield fname
1562 # Create a group generator and only pass in a changenode
1563 # lookup function as we need to collect no information
1564 # from filenodes.
1565 def flookup(revlog, x):
1566 # even though we print the same progress on
1567 # most loop iterations, put the progress call
1568 # here so that time estimates (if any) can be updated
1569 self.ui.progress(
1570 _('bundling'), idx, item=fname,
1571 unit=_('files'), total=efiles)
1572 return missingfnodes[x]
1557 first = True
1573 1558
1574 for chunk in filerevlog.group(missingfnodes, flookup):
1575 yield chunk
1559 def flookup(revlog, x):
1560 # even though we print the same progress on
1561 # most loop iterations, put the progress call
1562 # here so that time estimates (if any) can be updated
1563 self.ui.progress(
1564 _('bundling'), idx, item=fname,
1565 unit=_('files'), total=efiles)
1566 return missingfnodes[x]
1567
1568 for chunk in filerevlog.group(missingfnodes, flookup):
1569 if first:
1570 if chunk == changegroup.closechunk():
1571 break
1572 yield changegroup.chunkheader(len(fname))
1573 yield fname
1574 first = False
1575 yield chunk
1576 1576 # Signal that no more groups are left.
1577 1577 yield changegroup.closechunk()
1578 1578 self.ui.progress(_('bundling'), None)
@@ -1645,19 +1645,22 b' class localrepository(repo.repository):'
1645 1645 filerevlog = self.file(fname)
1646 1646 if not len(filerevlog):
1647 1647 raise util.Abort(_("empty or missing revlog for %s") % fname)
1648 first = True
1648 1649 nodeiter = gennodelst(filerevlog)
1649 nodeiter = list(nodeiter)
1650 if nodeiter:
1651 yield changegroup.chunkheader(len(fname))
1652 yield fname
1653 def flookup(revlog, x):
1654 self.ui.progress(
1655 _('bundling'), idx, item=fname,
1656 total=efiles, unit=_('files'))
1657 return cl.node(revlog.linkrev(revlog.rev(x)))
1650 def flookup(revlog, x):
1651 self.ui.progress(
1652 _('bundling'), idx, item=fname,
1653 total=efiles, unit=_('files'))
1654 return cl.node(revlog.linkrev(revlog.rev(x)))
1658 1655
1659 for chunk in filerevlog.group(nodeiter, flookup):
1660 yield chunk
1656 for chunk in filerevlog.group(nodeiter, flookup):
1657 if first:
1658 if chunk == changegroup.closechunk():
1659 break
1660 yield changegroup.chunkheader(len(fname))
1661 yield fname
1662 first = False
1663 yield chunk
1661 1664 self.ui.progress(_('bundling'), None)
1662 1665
1663 1666 yield changegroup.closechunk()
General Comments 0
You need to be logged in to leave comments. Login now