[PATCH 6 of 7 RFC v2] filelog: censored files compare against empty data, have 0 size

Matt Mackall mpm at selenic.com
Wed Oct 1 11:52:19 CDT 2014


On Mon, 2014-09-15 at 08:01 -0400, Mike Edgar wrote:
> # HG changeset patch
> # User Mike Edgar <adgar at google.com>
> # Date 1410741154 14400
> #      Sun Sep 14 20:32:34 2014 -0400
> # Node ID 03684b2891165ba0f6626216a1a6eaed4c502547
> # Parent  cb2d62a677e6df6b50df1699e7eea212a82af98d
> filelog: censored files compare against empty data, have 0 size

I've queued 1, 2, and 6 here. But I'm not convinced about the layering
of the policy bits yet. Basically, I think we need to have less
knowledge about censored files at high levels like this, otherwise we'll
end up with special case code everywhere.

I think we should instead have two behaviors when we ask for file
contents:

- abort (default, but hint about the next option)
- quietly treat file as empty

..and have this buried down in the fctx layer (which is the lowest layer
that has access to a ui object).

Before we add in a config file, we should probably first add a master
config switch that just chooses between the above two basic behaviors.
We can add in a policy file as a later step. You've used censor.allow
for this, but it might be better as censor.policy=abort/ignore/file.

And then we get something like:

$ hg update
abort: file censored .config at XXXX!
(use --config censor.policy=ignore to continue)

Also, we probably don't want verify to warn about ancient censored nodes
if policy allows them because it'll distract from real issues.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list