[PATCH] hgweb: add some in-code documentation for 'web.view'

Pierre-Yves David pierre-yves.david at ens-lyon.org
Fri Jun 12 20:34:32 CDT 2015


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at logilab.fr>
# Date 1360197146 0
#      Thu Feb 07 00:32:26 2013 +0000
# Node ID d51ae014b187acc7f8edc46a654d57889bcaeffb
# Parent  e8075329c5fbb651508777c15cb6bc9ae33b5dff
hgweb: add some in-code documentation for 'web.view'

This documentation was mostly intended for the user helps. However given the
lack of request for such feature, we should keep it un-documented. We stick the
help text in the code as it could still be useful to fellow contributors.

diff --git a/mercurial/hgweb/hgweb_mod.py b/mercurial/hgweb/hgweb_mod.py
--- a/mercurial/hgweb/hgweb_mod.py
+++ b/mercurial/hgweb/hgweb_mod.py
@@ -98,10 +98,20 @@ class hgweb(object):
     def configlist(self, section, name, default=None, untrusted=True):
         return self.repo.ui.configlist(section, name, default,
                                        untrusted=untrusted)
 
     def _getview(self, repo):
+        """The 'web.view' config controls Changesets filter to hgweb. Possible
+        values are ``served``, ``visible`` and ``all``. Default is ``served``.
+        The ``served`` filter only shows changesets that can be pulled from the
+        hgweb instance.  The``visible`` filter includes secret changesets but
+        still excludes "hidden" one.
+
+        See the repoview module for details.
+
+        The option have been around undocumented since Mercurial 2.5, but no
+        user ever asked about it. So we better keep it undocumented for now."""
         viewconfig = repo.ui.config('web', 'view', 'served',
                                     untrusted=True)
         if viewconfig == 'all':
             return repo.unfiltered()
         elif viewconfig in repoview.filtertable:


More information about the Mercurial-devel mailing list