##// END OF EJS Templates
storage: also use `deltamode argument` for ifiledata...
Boris Feld -
r40457:6a917075 default
parent child Browse files
Show More
@@ -697,12 +697,16 b' def deltagroup(repo, store, nodes, ischa'
697 progress = repo.ui.makeprogress(topic, unit=_('chunks'),
697 progress = repo.ui.makeprogress(topic, unit=_('chunks'),
698 total=len(nodes))
698 total=len(nodes))
699
699
700 deltamode = repository.CG_DELTAMODE_STD
701 if forcedeltaparentprev:
702 deltamode = repository.CG_DELTAMODE_PREV
703
700 revisions = store.emitrevisions(
704 revisions = store.emitrevisions(
701 nodes,
705 nodes,
702 nodesorder=nodesorder,
706 nodesorder=nodesorder,
703 revisiondata=True,
707 revisiondata=True,
704 assumehaveparentrevisions=not ellipses,
708 assumehaveparentrevisions=not ellipses,
705 deltaprevious=forcedeltaparentprev)
709 deltamode=deltamode)
706
710
707 for i, revision in enumerate(revisions):
711 for i, revision in enumerate(revisions):
708 if progress:
712 if progress:
@@ -92,11 +92,11 b' class filelog(object):'
92
92
93 def emitrevisions(self, nodes, nodesorder=None,
93 def emitrevisions(self, nodes, nodesorder=None,
94 revisiondata=False, assumehaveparentrevisions=False,
94 revisiondata=False, assumehaveparentrevisions=False,
95 deltaprevious=False):
95 deltamode=repository.CG_DELTAMODE_STD):
96 return self._revlog.emitrevisions(
96 return self._revlog.emitrevisions(
97 nodes, nodesorder=nodesorder, revisiondata=revisiondata,
97 nodes, nodesorder=nodesorder, revisiondata=revisiondata,
98 assumehaveparentrevisions=assumehaveparentrevisions,
98 assumehaveparentrevisions=assumehaveparentrevisions,
99 deltaprevious=deltaprevious)
99 deltamode=deltamode)
100
100
101 def addrevision(self, revisiondata, transaction, linkrev, p1, p2,
101 def addrevision(self, revisiondata, transaction, linkrev, p1, p2,
102 node=None, flags=revlog.REVIDX_DEFAULT_FLAGS,
102 node=None, flags=revlog.REVIDX_DEFAULT_FLAGS,
@@ -1575,11 +1575,11 b' class manifestrevlog(object):'
1575
1575
1576 def emitrevisions(self, nodes, nodesorder=None,
1576 def emitrevisions(self, nodes, nodesorder=None,
1577 revisiondata=False, assumehaveparentrevisions=False,
1577 revisiondata=False, assumehaveparentrevisions=False,
1578 deltaprevious=False):
1578 deltamode=repository.CG_DELTAMODE_STD):
1579 return self._revlog.emitrevisions(
1579 return self._revlog.emitrevisions(
1580 nodes, nodesorder=nodesorder, revisiondata=revisiondata,
1580 nodes, nodesorder=nodesorder, revisiondata=revisiondata,
1581 assumehaveparentrevisions=assumehaveparentrevisions,
1581 assumehaveparentrevisions=assumehaveparentrevisions,
1582 deltaprevious=deltaprevious)
1582 deltamode=deltamode)
1583
1583
1584 def addgroup(self, deltas, linkmapper, transaction, addrevisioncb=None):
1584 def addgroup(self, deltas, linkmapper, transaction, addrevisioncb=None):
1585 return self._revlog.addgroup(deltas, linkmapper, transaction,
1585 return self._revlog.addgroup(deltas, linkmapper, transaction,
@@ -618,7 +618,7 b' class ifiledata(interfaceutil.Interface)'
618 nodesorder=None,
618 nodesorder=None,
619 revisiondata=False,
619 revisiondata=False,
620 assumehaveparentrevisions=False,
620 assumehaveparentrevisions=False,
621 deltaprevious=False):
621 deltamode=CG_DELTAMODE_STD):
622 """Produce ``irevisiondelta`` for revisions.
622 """Produce ``irevisiondelta`` for revisions.
623
623
624 Given an iterable of nodes, emits objects conforming to the
624 Given an iterable of nodes, emits objects conforming to the
@@ -661,10 +661,10 b' class ifiledata(interfaceutil.Interface)'
661 The ``linknode`` attribute on the returned ``irevisiondelta`` may not
661 The ``linknode`` attribute on the returned ``irevisiondelta`` may not
662 be set and it is the caller's responsibility to resolve it, if needed.
662 be set and it is the caller's responsibility to resolve it, if needed.
663
663
664 If ``deltaprevious`` is True and revision data is requested, all
664 If ``deltamode`` is CG_DELTAMODE_PREV and revision data is requested,
665 revision data should be emitted as deltas against the revision
665 all revision data should be emitted as deltas against the revision
666 emitted just prior. The initial revision should be a delta against
666 emitted just prior. The initial revision should be a delta against its
667 its 1st parent.
667 1st parent.
668 """
668 """
669
669
670 class ifilemutation(interfaceutil.Interface):
670 class ifilemutation(interfaceutil.Interface):
@@ -2205,7 +2205,8 b' class revlog(object):'
2205 return res
2205 return res
2206
2206
2207 def emitrevisions(self, nodes, nodesorder=None, revisiondata=False,
2207 def emitrevisions(self, nodes, nodesorder=None, revisiondata=False,
2208 assumehaveparentrevisions=False, deltaprevious=False):
2208 assumehaveparentrevisions=False,
2209 deltamode=repository.CG_DELTAMODE_STD):
2209 if nodesorder not in ('nodes', 'storage', None):
2210 if nodesorder not in ('nodes', 'storage', None):
2210 raise error.ProgrammingError('unhandled value for nodesorder: %s' %
2211 raise error.ProgrammingError('unhandled value for nodesorder: %s' %
2211 nodesorder)
2212 nodesorder)
@@ -2213,10 +2214,8 b' class revlog(object):'
2213 if nodesorder is None and not self._generaldelta:
2214 if nodesorder is None and not self._generaldelta:
2214 nodesorder = 'storage'
2215 nodesorder = 'storage'
2215
2216
2216 deltamode = repository.CG_DELTAMODE_STD
2217 if (not self._storedeltachains and
2217 if deltaprevious:
2218 deltamode != repository.CG_DELTAMODE_PREV):
2218 deltamode = repository.CG_DELTAMODE_PREV
2219 elif not self._storedeltachains:
2220 deltamode = repository.CG_DELTAMODE_FULL
2219 deltamode = repository.CG_DELTAMODE_FULL
2221
2220
2222 return storageutil.emitrevisions(
2221 return storageutil.emitrevisions(
@@ -741,7 +741,8 b' class ifiledatatests(basetestcase):'
741
741
742 # forceprevious=True forces a delta against the previous revision.
742 # forceprevious=True forces a delta against the previous revision.
743 # Special case for initial revision.
743 # Special case for initial revision.
744 gen = f.emitrevisions([node0], revisiondata=True, deltaprevious=True)
744 gen = f.emitrevisions([node0], revisiondata=True,
745 deltamode=repository.CG_DELTAMODE_PREV)
745
746
746 rev = next(gen)
747 rev = next(gen)
747 self.assertEqual(rev.node, node0)
748 self.assertEqual(rev.node, node0)
@@ -758,7 +759,7 b' class ifiledatatests(basetestcase):'
758 next(gen)
759 next(gen)
759
760
760 gen = f.emitrevisions([node0, node2], revisiondata=True,
761 gen = f.emitrevisions([node0, node2], revisiondata=True,
761 deltaprevious=True)
762 deltamode=repository.CG_DELTAMODE_PREV)
762
763
763 rev = next(gen)
764 rev = next(gen)
764 self.assertEqual(rev.node, node0)
765 self.assertEqual(rev.node, node0)
General Comments 0
You need to be logged in to leave comments. Login now