Mercurial > hg
changeset 24119:a5a06c9c7407
mdiff: add helper for making deltas which replace the full text of a revision
This helper will be used initially for censor-aware delta generation. Deltas
which replace the full contents of the base revision are guaranteed to apply
correctly regardless of whether the delta recipient has censored the base.
For background and broader design of the censorship feature, see:
http://mercurial.selenic.com/wiki/CensorPlan
author | Mike Edgar <adgar@google.com> |
---|---|
date | Wed, 21 Jan 2015 16:35:09 -0500 |
parents | 76f6ae06ddf5 |
children | a450e0a2ba0a |
files | mercurial/mdiff.py |
diffstat | 1 files changed, 3 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/mdiff.py Fri Jan 23 17:01:39 2015 -0500 +++ b/mercurial/mdiff.py Wed Jan 21 16:35:09 2015 -0500 @@ -367,6 +367,9 @@ def trivialdiffheader(length): return struct.pack(">lll", 0, 0, length) +def replacediffheader(oldlen, newlen): + return struct.pack(">lll", 0, oldlen, newlen) + patches = mpatch.patches patchedsize = mpatch.patchedsize textdiff = bdiff.bdiff