Mercurial > public > mercurial-scm > hg
comparison mercurial/filelog.py @ 24117:9cfd7c4f22f5
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
author | Mike Edgar <adgar@google.com> |
---|---|
date | Fri, 06 Feb 2015 01:44:24 +0000 |
parents | b95a5bb58653 |
children | 76f6ae06ddf5 |
comparison
equal
deleted
inserted
replaced
24116:8b90a60181d1 | 24117:9cfd7c4f22f5 |
---|---|
27 metatext = "".join("%s: %s\n" % (k, meta[k]) for k in keys) | 27 metatext = "".join("%s: %s\n" % (k, meta[k]) for k in keys) |
28 return "\1\n%s\1\n%s" % (metatext, text) | 28 return "\1\n%s\1\n%s" % (metatext, text) |
29 | 29 |
30 def _censoredtext(text): | 30 def _censoredtext(text): |
31 m, offs = parsemeta(text) | 31 m, offs = parsemeta(text) |
32 return m and "censored" in m and not text[offs:] | 32 return m and "censored" in m |
33 | 33 |
34 class filelog(revlog.revlog): | 34 class filelog(revlog.revlog): |
35 def __init__(self, opener, path): | 35 def __init__(self, opener, path): |
36 super(filelog, self).__init__(opener, | 36 super(filelog, self).__init__(opener, |
37 "/".join(("data", path + ".i"))) | 37 "/".join(("data", path + ".i"))) |