changeset 35061:6ef744a7df65

config: rename allow_push to allow-push As part of ConfigConsolidationPlan [1], rename the option according to the new UI guidelines [2] and add an alias for backward compatibility. [1]: https://www.mercurial-scm.org/wiki/ConfigConsolidationPlan [2]: https://www.mercurial-scm.org/wiki/UIGuideline#adding_new_options
author David Demelier <markand@malikania.fr>
date Thu, 19 Oct 2017 11:46:41 +0200
parents da5d5ea7d696
children d7a4384d2d87
files mercurial/commands.py mercurial/configitems.py mercurial/help/config.txt mercurial/hgweb/common.py
diffstat 4 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Thu Oct 19 11:43:19 2017 +0200
+++ b/mercurial/commands.py	Thu Oct 19 11:46:41 2017 +0200
@@ -4695,7 +4695,7 @@
 
     Please note that the server does not implement access control.
     This means that, by default, anybody can read from the server and
-    nobody can write to it by default. Set the ``web.allow_push``
+    nobody can write to it by default. Set the ``web.allow-push``
     option to ``*`` to allow everybody to push to the server. You
     should use a real web server if you need to authenticate users.
 
--- a/mercurial/configitems.py	Thu Oct 19 11:43:19 2017 +0200
+++ b/mercurial/configitems.py	Thu Oct 19 11:46:41 2017 +0200
@@ -1010,7 +1010,8 @@
     alias=[('web', 'allowpull')],
     default=True,
 )
-coreconfigitem('web', 'allow_push',
+coreconfigitem('web', 'allow-push',
+    alias=[('web', 'allow_push')],
     default=list,
 )
 coreconfigitem('web', 'allowzip',
--- a/mercurial/help/config.txt	Thu Oct 19 11:43:19 2017 +0200
+++ b/mercurial/help/config.txt	Thu Oct 19 11:46:41 2017 +0200
@@ -2260,7 +2260,7 @@
 you want it to accept pushes from anybody, you can use the following
 command line::
 
-    $ hg --config web.allow_push=* --config web.push_ssl=False serve
+    $ hg --config web.allow-push=* --config web.push_ssl=False serve
 
 Note that this will allow anybody to push anything to the server and
 that this should not be used for public servers.
@@ -2290,13 +2290,13 @@
 ``allow-pull``
     Whether to allow pulling from the repository. (default: True)
 
-``allow_push``
+``allow-push``
     Whether to allow pushing to the repository. If empty or not set,
     pushing is not allowed. If the special value ``*``, any remote
     user can push, including unauthenticated users. Otherwise, the
     remote user must have been authenticated, and the authenticated
     user name must be present in this list. The contents of the
-    allow_push list are examined after the deny_push list.
+    allow-push list are examined after the deny_push list.
 
 ``allow_read``
     If the user has not already been denied repository access due to
@@ -2390,7 +2390,7 @@
     push is not denied. If the special value ``*``, all remote users are
     denied push. Otherwise, unauthenticated users are all denied, and
     any authenticated user name present in this list is also denied. The
-    contents of the deny_push list are examined before the allow_push list.
+    contents of the deny_push list are examined before the allow-push list.
 
 ``deny_read``
     Whether to deny reading/viewing of the repository. If this list is
--- a/mercurial/hgweb/common.py	Thu Oct 19 11:43:19 2017 +0200
+++ b/mercurial/hgweb/common.py	Thu Oct 19 11:46:41 2017 +0200
@@ -75,7 +75,7 @@
     if deny and (not user or ismember(hgweb.repo.ui, user, deny)):
         raise ErrorResponse(HTTP_UNAUTHORIZED, 'push not authorized')
 
-    allow = hgweb.configlist('web', 'allow_push')
+    allow = hgweb.configlist('web', 'allow-push')
     if not (allow and ismember(hgweb.repo.ui, user, allow)):
         raise ErrorResponse(HTTP_UNAUTHORIZED, 'push not authorized')