mirror of
https://github.com/facebook/sapling.git
synced 2024-10-06 23:07:18 +03:00
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
This commit is contained in:
parent
c736894d9c
commit
af0ba8e839
@ -367,6 +367,9 @@ def get_matching_blocks(a, b):
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user