[PATCH] config: rename allow_archive to allow-archive

David Demelier markand at malikania.fr
Mon May 14 06:38:14 EDT 2018


# HG changeset patch
# User David Demelier <markand at malikania.fr>
# Date 1526294285 -7200
#      Mon May 14 12:38:05 2018 +0200
# Node ID 821fe642e4397b2c48bd4000a6d9618548cefa3b
# Parent  8ba0344f9fb145f5b9b909f1211defc9e0793f68
config: rename allow_archive to allow-archive

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

diff -r 8ba0344f9fb1 -r 821fe642e439 i18n/da.po
--- a/i18n/da.po	Fri May 11 22:07:43 2018 -0400
+++ b/i18n/da.po	Mon May 14 12:38:05 2018 +0200
@@ -13696,7 +13696,7 @@
 msgstr ""
 
 msgid ""
-"``allow_archive``\n"
+"``allow-archive``\n"
 "    List of archive format (bz2, gz, zip) allowed for downloading.\n"
 "    Default is empty."
 msgstr ""
diff -r 8ba0344f9fb1 -r 821fe642e439 i18n/de.po
--- a/i18n/de.po	Fri May 11 22:07:43 2018 -0400
+++ b/i18n/de.po	Mon May 14 12:38:05 2018 +0200
@@ -17347,7 +17347,7 @@
 msgstr ""
 
 msgid ""
-"``allow_archive``\n"
+"``allow-archive``\n"
 "    List of archive format (bz2, gz, zip) allowed for downloading.\n"
 "    Default is empty."
 msgstr ""
diff -r 8ba0344f9fb1 -r 821fe642e439 i18n/ja.po
--- a/i18n/ja.po	Fri May 11 22:07:43 2018 -0400
+++ b/i18n/ja.po	Mon May 14 12:38:05 2018 +0200
@@ -23682,11 +23682,11 @@
 "    サーバの待ちうけアドレス。 (デフォルト値: ホストの持つ全アドレス)"
 
 msgid ""
-"``allow_archive``\n"
+"``allow-archive``\n"
 "    List of archive format (bz2, gz, zip) allowed for downloading.\n"
 "    (default: empty)"
 msgstr ""
-"``allow_archive``\n"
+"``allow-archive``\n"
 "    利用可能なダウンロード向けのアーカイブ形式 (bz2, gz, zip) 一覧。\n"
 "    (デフォルト値: 空 = ダウンロード不可)"
 
diff -r 8ba0344f9fb1 -r 821fe642e439 i18n/pt_BR.po
--- a/i18n/pt_BR.po	Fri May 11 22:07:43 2018 -0400
+++ b/i18n/pt_BR.po	Mon May 14 12:38:05 2018 +0200
@@ -27391,11 +27391,11 @@
 "    (padrão: usa todos os endereços)"
 
 msgid ""
-"``allow_archive``\n"
+"``allow-archive``\n"
 "    List of archive format (bz2, gz, zip) allowed for downloading.\n"
 "    (default: empty)"
 msgstr ""
-"``allow_archive``\n"
+"``allow-archive``\n"
 "    Lista de formatos de pacote (bz2, gz, zip) permitidos para download.\n"
 "    (padrão: lista vazia)"
 
diff -r 8ba0344f9fb1 -r 821fe642e439 i18n/ro.po
--- a/i18n/ro.po	Fri May 11 22:07:43 2018 -0400
+++ b/i18n/ro.po	Mon May 14 12:38:05 2018 +0200
@@ -12099,7 +12099,7 @@
 msgstr ""
 
 msgid ""
-"``allow_archive``\n"
+"``allow-archive``\n"
 "    List of archive format (bz2, gz, zip) allowed for downloading.\n"
 "    Default is empty."
 msgstr ""
diff -r 8ba0344f9fb1 -r 821fe642e439 i18n/ru.po
--- a/i18n/ru.po	Fri May 11 22:07:43 2018 -0400
+++ b/i18n/ru.po	Mon May 14 12:38:05 2018 +0200
@@ -19776,11 +19776,11 @@
 "    Адрес прослушиваемого интерфейса. По умолчанию все интерфейсы."
 
 msgid ""
-"``allow_archive``\n"
+"``allow-archive``\n"
 "    List of archive format (bz2, gz, zip) allowed for downloading.\n"
 "    Default is empty."
 msgstr ""
-"``allow_archive``\n"
+"``allow-archive``\n"
 "    Список форматов архивов (bz2, gz, zip), которые можно скачивать.\n"
 "    По умолчанию пуст."
 
diff -r 8ba0344f9fb1 -r 821fe642e439 i18n/sv.po
--- a/i18n/sv.po	Fri May 11 22:07:43 2018 -0400
+++ b/i18n/sv.po	Mon May 14 12:38:05 2018 +0200
@@ -15034,7 +15034,7 @@
 msgstr ""
 
 msgid ""
-"``allow_archive``\n"
+"``allow-archive``\n"
 "    List of archive format (bz2, gz, zip) allowed for downloading.\n"
 "    Default is empty."
 msgstr ""
diff -r 8ba0344f9fb1 -r 821fe642e439 mercurial/configitems.py
--- a/mercurial/configitems.py	Fri May 11 22:07:43 2018 -0400
+++ b/mercurial/configitems.py	Mon May 14 12:38:05 2018 +0200
@@ -1222,7 +1222,8 @@
 coreconfigitem('web', 'address',
     default='',
 )
-coreconfigitem('web', 'allow_archive',
+coreconfigitem('web', 'allow-archive',
+    alias=[('web', 'allow_archive')],
     default=list,
 )
 coreconfigitem('web', 'allow_read',
diff -r 8ba0344f9fb1 -r 821fe642e439 mercurial/help/config.txt
--- a/mercurial/help/config.txt	Fri May 11 22:07:43 2018 -0400
+++ b/mercurial/help/config.txt	Mon May 14 12:38:05 2018 +0200
@@ -2325,7 +2325,7 @@
 ``address``
     Interface address to bind to. (default: all)
 
-``allow_archive``
+``allow-archive``
     List of archive format (bz2, gz, zip) allowed for downloading.
     (default: empty)
 
diff -r 8ba0344f9fb1 -r 821fe642e439 mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py	Fri May 11 22:07:43 2018 -0400
+++ b/mercurial/hgweb/webcommands.py	Mon May 14 12:38:05 2018 +0200
@@ -1161,7 +1161,7 @@
     """
 
     type_ = web.req.qsparams.get('type')
-    allowed = web.configlist("web", "allow_archive")
+    allowed = web.configlist("web", "allow-archive")
     key = web.req.qsparams['node']
 
     if type_ not in webutil.archivespecs:
diff -r 8ba0344f9fb1 -r 821fe642e439 mercurial/hgweb/webutil.py
--- a/mercurial/hgweb/webutil.py	Fri May 11 22:07:43 2018 -0400
+++ b/mercurial/hgweb/webutil.py	Mon May 14 12:38:05 2018 +0200
@@ -51,7 +51,7 @@
 ))
 
 def archivelist(ui, nodeid, url=None):
-    allowed = ui.configlist('web', 'allow_archive', untrusted=True)
+    allowed = ui.configlist('web', 'allow-archive', untrusted=True)
     archives = []
 
     for typ, spec in archivespecs.iteritems():
diff -r 8ba0344f9fb1 -r 821fe642e439 tests/test-archive.t
--- a/tests/test-archive.t	Fri May 11 22:07:43 2018 -0400
+++ b/tests/test-archive.t	Mon May 14 12:38:05 2018 +0200
@@ -94,7 +94,7 @@
   $ echo "archivesubrepos = True" >> .hg/hgrc
   $ cp .hg/hgrc .hg/hgrc-base
   > test_archtype() {
-  >     echo "allow_archive = $1" >> .hg/hgrc
+  >     echo "allow-archive = $1" >> .hg/hgrc
   >     test_archtype_run "$@"
   > }
   > test_archtype_deprecated() {
@@ -293,7 +293,7 @@
   
   body: size=1451, sha1=4c5cf0f574446c44feb7f88f4e0e2a56bd92c352
 
-  $ echo "allow_archive = gz bz2 zip" >> .hg/hgrc
+  $ echo "allow-archive = gz bz2 zip" >> .hg/hgrc
   $ hg serve -p $HGPORT -d --pid-file=hg.pid -E errors.log
   $ cat hg.pid >> $DAEMON_PIDS
 
diff -r 8ba0344f9fb1 -r 821fe642e439 tests/test-hgweb-json.t
--- a/tests/test-hgweb-json.t	Fri May 11 22:07:43 2018 -0400
+++ b/tests/test-hgweb-json.t	Mon May 14 12:38:05 2018 +0200
@@ -101,7 +101,7 @@
   
 
   $ echo '[web]' >> .hg/hgrc
-  $ echo 'allow_archive = bz2' >> .hg/hgrc
+  $ echo 'allow-archive = bz2' >> .hg/hgrc
   $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E error.log
   $ cat hg.pid >> $DAEMON_PIDS
 
diff -r 8ba0344f9fb1 -r 821fe642e439 tests/test-hgweb-symrev.t
--- a/tests/test-hgweb-symrev.t	Fri May 11 22:07:43 2018 -0400
+++ b/tests/test-hgweb-symrev.t	Mon May 14 12:38:05 2018 +0200
@@ -30,7 +30,7 @@
   |
   o  0:43c799df6e75
   
-  $ hg serve --config web.allow_archive=zip -n test -p $HGPORT -d --pid-file=hg.pid -E errors.log
+  $ hg serve --config web.allow-archive=zip -n test -p $HGPORT -d --pid-file=hg.pid -E errors.log
   $ cat hg.pid >> $DAEMON_PIDS
 
   $ REVLINKS='href=[^>]+(rev=|/)(43c799df6e75|0|a7c1559b7bba|1|xyzzy|9d8c40cba617|2|tip|default)'
diff -r 8ba0344f9fb1 -r 821fe642e439 tests/test-largefiles-wireproto.t
--- a/tests/test-largefiles-wireproto.t	Fri May 11 22:07:43 2018 -0400
+++ b/tests/test-largefiles-wireproto.t	Mon May 14 12:38:05 2018 +0200
@@ -26,7 +26,7 @@
   > patterns=glob:**.dat
   > usercache=${USERCACHE}
   > [web]
-  > allow_archive = zip
+  > allow-archive = zip
   > [hooks]
   > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
   > EOF


More information about the Mercurial-devel mailing list