censor: document the censor.policy option (issue6909)
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 05 Sep 2024 12:37:59 +0200
changeset 51845 cd72a88c5599
parent 51844 76387080f238
child 51846 243e805e8a2d
censor: document the censor.policy option (issue6909) Censor is not marked as experimental and should be documented I am not doing this on stable because the help markup change it is using seems more suitable for default.
hgext/censor.py
mercurial/configitems.toml
mercurial/helptext/config.txt
--- a/hgext/censor.py	Thu Sep 05 12:28:12 2024 +0200
+++ b/hgext/censor.py	Thu Sep 05 12:37:59 2024 +0200
@@ -24,10 +24,11 @@
 function in a meaningful way. Such commands only tolerate censored file
 As having a censored version in a checkout is impractical. The current head
 revisions of the repository are checked. If the revision to be censored is in
-any of them the command will abort.
+any of them the command will abort. You can configure this behavior using the
+following option:
 
-A few informative commands such as ``hg grep`` will unconditionally
-ignore censored data and merely report that it was encountered.
+    `censor.policy`
+        :config-doc:`censor.policy`
 """
 
 
--- a/mercurial/configitems.toml	Thu Sep 05 12:28:12 2024 +0200
+++ b/mercurial/configitems.toml	Thu Sep 05 12:37:59 2024 +0200
@@ -65,7 +65,13 @@
 section = "censor"
 name = "policy"
 default = "abort"
-experimental = true
+documentation="""Control how to react when accessing censored content.
+Accepted value: "abort", "ignore". Defaults to abort.
+
+A few informative commands such as ``hg grep`` will unconditionally ignore
+censored data and merely report that it was encountered.
+"""
+
 
 [[items]]
 section = "chgserver"
--- a/mercurial/helptext/config.txt	Thu Sep 05 12:28:12 2024 +0200
+++ b/mercurial/helptext/config.txt	Thu Sep 05 12:37:59 2024 +0200
@@ -418,6 +418,12 @@
 If no suitable authentication entry is found, the user is prompted
 for credentials as usual if required by the remote.
 
+``censor``
+----------
+
+``policy``
+    :config-doc:`censor.policy`
+
 ``cmdserver``
 -------------