Mercurial > hg
comparison mercurial/filelog.py @ 39231:b41d023a412a
repository: establish API for emitting revision deltas
With our revision delta and revision delta request interfaces
defined, it is now time to define a method on storage interfaces
for using them.
So far, the only storage interface that is well-defined and used
is file storage. So that is the only interface we need to add a
method on.
We define an ``emitrevisiondeltas()`` method that takes an
iterable of ``irevisiondeltarequest``s and turns them into
``irevisiondelta`` instances.
changegroup._handlerevisiondeltarequest() and the looping logic
from changegroup.deltagroup() has effectively been moved to
revlog.emitrevisiondeltas().
Our filelog wrapper class proxies its emitrevisiondeltas() to
the internal revlog instance.
The simple store test extension used to verify sanity of storage
abstractions has also implemented emitrevisiondeltas() for
file storage and the test harness when run with this extension doesn't
seem to exhibit any regressions.
Rather than create a shared type to represent revision deltas,
each storage backend has its own type and the class name identifies
where the revision delta was derived from.
Differential Revision: https://phab.mercurial-scm.org/D4226
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Thu, 09 Aug 2018 16:02:14 -0700 |
parents | 93777d16a25d |
children | 0a5b20c107a6 |
comparison
equal
deleted
inserted
replaced
39230:b518d495a560 | 39231:b41d023a412a |
---|---|
93 return self._revlog.revision(node, _df=_df, raw=raw) | 93 return self._revlog.revision(node, _df=_df, raw=raw) |
94 | 94 |
95 def revdiff(self, rev1, rev2): | 95 def revdiff(self, rev1, rev2): |
96 return self._revlog.revdiff(rev1, rev2) | 96 return self._revlog.revdiff(rev1, rev2) |
97 | 97 |
98 def emitrevisiondeltas(self, requests): | |
99 return self._revlog.emitrevisiondeltas(requests) | |
100 | |
98 def addrevision(self, revisiondata, transaction, linkrev, p1, p2, | 101 def addrevision(self, revisiondata, transaction, linkrev, p1, p2, |
99 node=None, flags=revlog.REVIDX_DEFAULT_FLAGS, | 102 node=None, flags=revlog.REVIDX_DEFAULT_FLAGS, |
100 cachedelta=None): | 103 cachedelta=None): |
101 return self._revlog.addrevision(revisiondata, transaction, linkrev, | 104 return self._revlog.addrevision(revisiondata, transaction, linkrev, |
102 p1, p2, node=node, flags=flags, | 105 p1, p2, node=node, flags=flags, |