Patchwork [1,of,4,censor,RFC] filelog: allow censored files to contain padding data

login
register
mail settings
Submitter adgar@google.com
Date Feb. 6, 2015, 3:57 a.m.
Message ID <e24ad0a4a1d819c4d797.1423195067@adgar.nyc.corp.google.com>
Download mbox | patch
Permalink /patch/7705/
State Accepted
Headers show

Comments

adgar@google.com - Feb. 6, 2015, 3:57 a.m.
# HG changeset patch
# User Mike Edgar <adgar@google.com>
# Date 1423187064 0
#      Fri Feb 06 01:44:24 2015 +0000
# Node ID e24ad0a4a1d819c4d79799b5a453987ea88e1b9e
# Parent  8b88870cbd1eeefaee0af053ae36728f8c0a1847
filelog: allow censored files to contain padding data

To ensure delta compatibility, when a revision is censored, it is
padded to match the original data in size. The previous check does
not allow for padding because it was added before padding was found
to be a requirement.

For more background and design of the censorship feature, see:
mercurial.selenic.com/wiki/CensorPlan

Patch

diff -r 8b88870cbd1e -r e24ad0a4a1d8 mercurial/filelog.py
--- a/mercurial/filelog.py	Fri Jan 16 10:57:13 2015 -0800
+++ b/mercurial/filelog.py	Fri Feb 06 01:44:24 2015 +0000
@@ -29,7 +29,7 @@ 
 
 def _censoredtext(text):
     m, offs = parsemeta(text)
-    return m and "censored" in m and not text[offs:]
+    return m and "censored" in m
 
 class filelog(revlog.revlog):
     def __init__(self, opener, path):