| 1 |
<?xml version="1.0" encoding="utf-8"?> |
| 2 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 3 |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| 4 |
<head> |
| 5 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| 6 |
<meta name="generator" content="Docutils 0.21.2: https://docutils.sourceforge.io/" /> |
| 7 |
<title>censor</title> |
| 8 |
<link rel="stylesheet" href="../style.css" type="text/css" /> |
| 9 |
</head> |
| 10 |
<body> |
| 11 |
<div class="document" id="censor"> |
| 12 |
<span id="ext-censor"></span> |
| 13 |
<h1 class="title">censor</h1> |
| 14 |
|
| 15 |
<div class="contents htmlonly topic" id="contents"> |
| 16 |
<p class="topic-title"><a class="reference internal" href="#top">Contents</a></p> |
| 17 |
<ul class="simple"> |
| 18 |
<li><a class="reference internal" href="#description" id="toc-entry-1">Description</a></li> |
| 19 |
<li><a class="reference internal" href="#commands" id="toc-entry-2">Commands</a><ul> |
| 20 |
<li><a class="reference internal" href="#repository-maintenance" id="toc-entry-3">Repository maintenance</a></li> |
| 21 |
</ul> |
| 22 |
</li> |
| 23 |
</ul> |
| 24 |
</div> |
| 25 |
<p>erase file content at a given revision</p> |
| 26 |
<div class="section" id="description"> |
| 27 |
<h1><a class="toc-backref" href="#contents">Description</a></h1> |
| 28 |
<p>The censor command instructs Mercurial to erase all content of a file at a given |
| 29 |
revision <em>without updating the changeset hash.</em> This allows existing history to |
| 30 |
remain valid while preventing future clones/pulls from receiving the erased |
| 31 |
data.</p> |
| 32 |
<p>Typical uses for censor are due to security or legal requirements, including:</p> |
| 33 |
<pre class="literal-block"> |
| 34 |
* Passwords, private keys, cryptographic material |
| 35 |
* Licensed data/code/libraries for which the license has expired |
| 36 |
* Personally Identifiable Information or other private data |
| 37 |
</pre> |
| 38 |
<p>Censored nodes can interrupt mercurial's typical operation whenever the excised |
| 39 |
data needs to be materialized. Some commands, like <tt class="docutils literal">hg cat</tt>/<tt class="docutils literal">hg revert</tt>, |
| 40 |
simply fail when asked to produce censored data. Others, like <tt class="docutils literal">hg verify</tt> and |
| 41 |
<tt class="docutils literal">hg update</tt>, must be capable of tolerating censored data to continue to |
| 42 |
function in a meaningful way. Such commands only tolerate censored file |
| 43 |
As having a censored version in a checkout is impractical. The current head |
| 44 |
revisions of the repository are checked. If the revision to be censored is in |
| 45 |
any of them the command will abort. You can configure this behavior using the |
| 46 |
following option:</p> |
| 47 |
<blockquote> |
| 48 |
<dl class="docutils"> |
| 49 |
<dt><cite>censor.policy</cite></dt> |
| 50 |
<dd><span class="config-doc">censor.policy</span></dd> |
| 51 |
</dl> |
| 52 |
</blockquote> |
| 53 |
</div> |
| 54 |
<div class="section" id="commands"> |
| 55 |
<h1><a class="toc-backref" href="#contents">Commands</a></h1> |
| 56 |
<div class="section" id="repository-maintenance"> |
| 57 |
<h2><a class="toc-backref" href="#contents">Repository maintenance</a></h2> |
| 58 |
<div class="section" id="censor-1"> |
| 59 |
<h3>censor</h3> |
| 60 |
<pre class="literal-block"> |
| 61 |
hg censor -r REV [-t TEXT] [FILE] |
| 62 |
</pre> |
| 63 |
<p>Options:</p> |
| 64 |
<table class="docutils option-list" frame="void" rules="none"> |
| 65 |
<col class="option" /> |
| 66 |
<col class="description" /> |
| 67 |
<tbody valign="top"> |
| 68 |
<tr><td class="option-group" colspan="2"> |
| 69 |
<kbd><span class="option">-r</span>, <span class="option">--rev <var><REV[+]></var></span></kbd></td> |
| 70 |
</tr> |
| 71 |
<tr><td> </td><td>censor file from specified revision</td></tr> |
| 72 |
<tr><td class="option-group"> |
| 73 |
<kbd><span class="option">--check-heads</span></kbd></td> |
| 74 |
<td>check that repository heads are not affected (default: True)</td></tr> |
| 75 |
<tr><td class="option-group" colspan="2"> |
| 76 |
<kbd><span class="option">-t</span>, <span class="option">--tombstone <var><TEXT></var></span></kbd></td> |
| 77 |
</tr> |
| 78 |
<tr><td> </td><td>replacement tombstone data</td></tr> |
| 79 |
</tbody> |
| 80 |
</table> |
| 81 |
<p>[+] marked option can be specified multiple times</p> |
| 82 |
</div> |
| 83 |
</div> |
| 84 |
</div> |
| 85 |
</div> |
| 86 |
</body> |
| 87 |
</html> |