mercurial/help/internals/censor.txt
author Matt Harbison <matt_harbison@yahoo.com>
Fri, 09 Jun 2017 22:15:53 -0400
changeset 32802 9a4adc76c88a
parent 31289 1b699a208cee
permissions -rw-r--r--
setup: avoid linker warnings on Windows about multiple export specifications The PyMODINIT_FUNC macro contains __declspec(dllexport), and then the build process adds an "/EXPORT func" to the command line. The 64-bit linker flags this [1]. Everything except zstd.c and bser.c are covered by redefining the macro in util.h [2]. These modules aren't built with util.h in the #include path, so the redefining hack would have to be open coded two more times. After seeing that extra_linker_flags didn't work, I couldn't find anything authoritative indicating why, though I did see an offhand comment on SO that CFLAGS is also ignored on Windows. I also don't fully understand the interaction between msvccompiler and msvc9compiler- I first subclassed the latter, but it isn't used when building with VS2008. I know the camelcase naming isn't the standard, but the HackedMingw32CCompiler class above it was introduced 5 years ago (and I think the current style was in place by then), so I assume that there's some reason for it. [1] https://support.microsoft.com/en-us/help/835326/you-receive-an-lnk4197-error-in-the-64-bit-version-of-the-visual-c-compiler [2] https://bugs.python.org/issue9709#msg120859
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
31289
1b699a208cee internals: add some brief documentation about censor
Augie Fackler <augie@google.com>
parents:
diff changeset
     1
The censor system allows retroactively removing content from
1b699a208cee internals: add some brief documentation about censor
Augie Fackler <augie@google.com>
parents:
diff changeset
     2
files. Actually censoring a node requires using the censor extension,
1b699a208cee internals: add some brief documentation about censor
Augie Fackler <augie@google.com>
parents:
diff changeset
     3
but the functionality for handling censored nodes is partially in core.
1b699a208cee internals: add some brief documentation about censor
Augie Fackler <augie@google.com>
parents:
diff changeset
     4
1b699a208cee internals: add some brief documentation about censor
Augie Fackler <augie@google.com>
parents:
diff changeset
     5
Censored nodes in a filelog have the flag ``REVIDX_ISCENSORED`` set,
1b699a208cee internals: add some brief documentation about censor
Augie Fackler <augie@google.com>
parents:
diff changeset
     6
and the contents of the censored node are replaced with a censor
1b699a208cee internals: add some brief documentation about censor
Augie Fackler <augie@google.com>
parents:
diff changeset
     7
tombstone. For historical reasons, the tombstone is packed in the
1b699a208cee internals: add some brief documentation about censor
Augie Fackler <augie@google.com>
parents:
diff changeset
     8
filelog metadata field ``censored``. This allows censored nodes to be
1b699a208cee internals: add some brief documentation about censor
Augie Fackler <augie@google.com>
parents:
diff changeset
     9
(mostly) safely transmitted through old formats like changegroup
1b699a208cee internals: add some brief documentation about censor
Augie Fackler <augie@google.com>
parents:
diff changeset
    10
versions 1 and 2. When using changegroup formats older than 3, the
1b699a208cee internals: add some brief documentation about censor
Augie Fackler <augie@google.com>
parents:
diff changeset
    11
receiver is required to re-add the ``REVIDX_ISCENSORED`` flag when
1b699a208cee internals: add some brief documentation about censor
Augie Fackler <augie@google.com>
parents:
diff changeset
    12
storing the revision. This depends on the ``censored`` metadata key
1b699a208cee internals: add some brief documentation about censor
Augie Fackler <augie@google.com>
parents:
diff changeset
    13
never being used for anything other than censoring revisions, which is
1b699a208cee internals: add some brief documentation about censor
Augie Fackler <augie@google.com>
parents:
diff changeset
    14
true as of January 2017. Note that the revlog flag is the
1b699a208cee internals: add some brief documentation about censor
Augie Fackler <augie@google.com>
parents:
diff changeset
    15
authoritative marker of a censored node: the tombstone should only be
1b699a208cee internals: add some brief documentation about censor
Augie Fackler <augie@google.com>
parents:
diff changeset
    16
consulted when looking for a reason a node was censored or when revlog
1b699a208cee internals: add some brief documentation about censor
Augie Fackler <augie@google.com>
parents:
diff changeset
    17
flags are unavailable as mentioned above.
1b699a208cee internals: add some brief documentation about censor
Augie Fackler <augie@google.com>
parents:
diff changeset
    18
1b699a208cee internals: add some brief documentation about censor
Augie Fackler <augie@google.com>
parents:
diff changeset
    19
The tombstone data is a free-form string. It's expected that users of
1b699a208cee internals: add some brief documentation about censor
Augie Fackler <augie@google.com>
parents:
diff changeset
    20
censor will want to record the reason for censoring a node in the
1b699a208cee internals: add some brief documentation about censor
Augie Fackler <augie@google.com>
parents:
diff changeset
    21
tombstone. Censored nodes must be able to fit in the size of the
1b699a208cee internals: add some brief documentation about censor
Augie Fackler <augie@google.com>
parents:
diff changeset
    22
content being censored.