# HG changeset patch # User Boris Feld # Date 1541427849 -3600 # Node ID 355ae096faef8945b66c1ae4e67a1cdc7130807c # Parent e14d44772fb39df4bf98b48b444092156ba587b3 perf: add `storage` as possible source for perfrevlogwrite This source will use the stored delta. diff -r e14d44772fb3 -r 355ae096faef contrib/perf.py --- a/contrib/perf.py Mon Nov 05 15:19:44 2018 +0100 +++ b/contrib/perf.py Mon Nov 05 15:24:09 2018 +0100 @@ -1584,6 +1584,7 @@ * `parent-2`: add from a delta to the second parent if it exists (use a delta from the first parent otherwise) * `parent-smallest`: add from the smallest delta (either p1 or p2) + * `storage`: add from the existing precomputed deltas """ opts = _byteskwargs(opts) @@ -1595,7 +1596,8 @@ stoprev = rllen + stoprev source = opts['source'] - validsource = (b'full', b'parent-1', b'parent-2', b'parent-smallest') + validsource = (b'full', b'parent-1', b'parent-2', b'parent-smallest', + b'storage') if source not in validsource: raise error.Abort('invalid source type: %s' % source) @@ -1719,6 +1721,9 @@ diff = p2diff baserev = orig.rev(parent) cachedelta = (baserev, diff) + elif source == b'storage': + baserev = orig.deltaparent(rev) + cachedelta = (baserev, orig.revdiff(orig.node(baserev), rev)) return ((text, tr, linkrev, p1, p2), {'node': node, 'flags': flags, 'cachedelta': cachedelta})