##// END OF EJS Templates
revlog: linearize created changegroups in generaldelta revlogs...
Sune Foldager -
r14365:a8e3931e default
parent child Browse files
Show More
@@ -1544,18 +1544,23 b' class localrepository(repo.repository):'
1544 return fstate[1][x]
1544 return fstate[1][x]
1545
1545
1546 bundler = changegroup.bundle10(lookup)
1546 bundler = changegroup.bundle10(lookup)
1547 reorder = self.ui.config('bundle', 'reorder', 'auto')
1548 if reorder == 'auto':
1549 reorder = None
1550 else:
1551 reorder = util.parsebool(reorder)
1547
1552
1548 def gengroup():
1553 def gengroup():
1549 # Create a changenode group generator that will call our functions
1554 # Create a changenode group generator that will call our functions
1550 # back to lookup the owning changenode and collect information.
1555 # back to lookup the owning changenode and collect information.
1551 for chunk in cl.group(csets, bundler):
1556 for chunk in cl.group(csets, bundler, reorder=reorder):
1552 yield chunk
1557 yield chunk
1553 self.ui.progress(_('bundling'), None)
1558 self.ui.progress(_('bundling'), None)
1554
1559
1555 # Create a generator for the manifestnodes that calls our lookup
1560 # Create a generator for the manifestnodes that calls our lookup
1556 # and data collection functions back.
1561 # and data collection functions back.
1557 count[0] = 0
1562 count[0] = 0
1558 for chunk in mf.group(prune(mf, mfs), bundler):
1563 for chunk in mf.group(prune(mf, mfs), bundler, reorder=reorder):
1559 yield chunk
1564 yield chunk
1560 self.ui.progress(_('bundling'), None)
1565 self.ui.progress(_('bundling'), None)
1561
1566
@@ -1572,7 +1577,7 b' class localrepository(repo.repository):'
1572 first = True
1577 first = True
1573
1578
1574 for chunk in filerevlog.group(prune(filerevlog, fstate[1]),
1579 for chunk in filerevlog.group(prune(filerevlog, fstate[1]),
1575 bundler):
1580 bundler, reorder=reorder):
1576 if first:
1581 if first:
1577 if chunk == bundler.close():
1582 if chunk == bundler.close():
1578 break
1583 break
@@ -1640,17 +1645,22 b' class localrepository(repo.repository):'
1640 return cl.node(revlog.linkrev(revlog.rev(x)))
1645 return cl.node(revlog.linkrev(revlog.rev(x)))
1641
1646
1642 bundler = changegroup.bundle10(lookup)
1647 bundler = changegroup.bundle10(lookup)
1648 reorder = self.ui.config('bundle', 'reorder', 'auto')
1649 if reorder == 'auto':
1650 reorder = None
1651 else:
1652 reorder = util.parsebool(reorder)
1643
1653
1644 def gengroup():
1654 def gengroup():
1645 '''yield a sequence of changegroup chunks (strings)'''
1655 '''yield a sequence of changegroup chunks (strings)'''
1646 # construct a list of all changed files
1656 # construct a list of all changed files
1647
1657
1648 for chunk in cl.group(nodes, bundler):
1658 for chunk in cl.group(nodes, bundler, reorder=reorder):
1649 yield chunk
1659 yield chunk
1650 self.ui.progress(_('bundling'), None)
1660 self.ui.progress(_('bundling'), None)
1651
1661
1652 count[0] = 0
1662 count[0] = 0
1653 for chunk in mf.group(gennodelst(mf), bundler):
1663 for chunk in mf.group(gennodelst(mf), bundler, reorder=reorder):
1654 yield chunk
1664 yield chunk
1655 self.ui.progress(_('bundling'), None)
1665 self.ui.progress(_('bundling'), None)
1656
1666
@@ -1661,7 +1671,8 b' class localrepository(repo.repository):'
1661 raise util.Abort(_("empty or missing revlog for %s") % fname)
1671 raise util.Abort(_("empty or missing revlog for %s") % fname)
1662 fstate[0] = fname
1672 fstate[0] = fname
1663 first = True
1673 first = True
1664 for chunk in filerevlog.group(gennodelst(filerevlog), bundler):
1674 for chunk in filerevlog.group(gennodelst(filerevlog), bundler,
1675 reorder=reorder):
1665 if first:
1676 if first:
1666 if chunk == bundler.close():
1677 if chunk == bundler.close():
1667 break
1678 break
@@ -14,7 +14,7 b' and O(changes) merge between branches.'
14 # import stuff from node for others to import from revlog
14 # import stuff from node for others to import from revlog
15 from node import bin, hex, nullid, nullrev, short #@UnusedImport
15 from node import bin, hex, nullid, nullrev, short #@UnusedImport
16 from i18n import _
16 from i18n import _
17 import ancestor, mdiff, parsers, error, util
17 import ancestor, mdiff, parsers, error, util, dagutil
18 import struct, zlib, errno
18 import struct, zlib, errno
19
19
20 _pack = struct.pack
20 _pack = struct.pack
@@ -1086,7 +1086,7 b' class revlog(object):'
1086 self._basecache = (curr, chainbase)
1086 self._basecache = (curr, chainbase)
1087 return node
1087 return node
1088
1088
1089 def group(self, nodelist, bundler):
1089 def group(self, nodelist, bundler, reorder=None):
1090 """Calculate a delta group, yielding a sequence of changegroup chunks
1090 """Calculate a delta group, yielding a sequence of changegroup chunks
1091 (strings).
1091 (strings).
1092
1092
@@ -1098,7 +1098,14 b' class revlog(object):'
1098 changegroup starts with a full revision.
1098 changegroup starts with a full revision.
1099 """
1099 """
1100
1100
1101 revs = sorted([self.rev(n) for n in nodelist])
1101 # for generaldelta revlogs, we linearize the revs; this will both be
1102 # much quicker and generate a much smaller bundle
1103 if (self._generaldelta and reorder is not False) or reorder:
1104 dag = dagutil.revlogdag(self)
1105 revs = set(self.rev(n) for n in nodelist)
1106 revs = dag.linearize(revs)
1107 else:
1108 revs = sorted([self.rev(n) for n in nodelist])
1102
1109
1103 # if we don't have any revisions touched by these changesets, bail
1110 # if we don't have any revisions touched by these changesets, bail
1104 if not revs:
1111 if not revs:
General Comments 0
You need to be logged in to leave comments. Login now