# HG changeset patch # User David Demelier # Date 2018-05-14 10:38:05 # Node ID f715faeaceeec38ff1551fbccdd45c0c0ba3df85 # Parent 2aa0217bb6559e49ec1ca8061be7dc108775d2d0 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 --git a/i18n/da.po b/i18n/da.po --- a/i18n/da.po +++ b/i18n/da.po @@ -13696,7 +13696,7 @@ msgid "" msgstr "" msgid "" -"``allow_archive``\n" +"``allow-archive``\n" " List of archive format (bz2, gz, zip) allowed for downloading.\n" " Default is empty." msgstr "" diff --git a/i18n/de.po b/i18n/de.po --- a/i18n/de.po +++ b/i18n/de.po @@ -17347,7 +17347,7 @@ msgid "" msgstr "" msgid "" -"``allow_archive``\n" +"``allow-archive``\n" " List of archive format (bz2, gz, zip) allowed for downloading.\n" " Default is empty." msgstr "" diff --git a/i18n/ja.po b/i18n/ja.po --- a/i18n/ja.po +++ b/i18n/ja.po @@ -23682,11 +23682,11 @@ msgstr "" " サーバの待ちうけアドレス。 (デフォルト値: ホストの持つ全アドレス)" 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 --git a/i18n/pt_BR.po b/i18n/pt_BR.po --- a/i18n/pt_BR.po +++ b/i18n/pt_BR.po @@ -27391,11 +27391,11 @@ msgstr "" " (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 --git a/i18n/ro.po b/i18n/ro.po --- a/i18n/ro.po +++ b/i18n/ro.po @@ -12099,7 +12099,7 @@ msgid "" msgstr "" msgid "" -"``allow_archive``\n" +"``allow-archive``\n" " List of archive format (bz2, gz, zip) allowed for downloading.\n" " Default is empty." msgstr "" diff --git a/i18n/ru.po b/i18n/ru.po --- a/i18n/ru.po +++ b/i18n/ru.po @@ -19776,11 +19776,11 @@ msgstr "" " Адрес прослушиваемого интерфейса. По умолчанию все интерфейсы." 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 --git a/i18n/sv.po b/i18n/sv.po --- a/i18n/sv.po +++ b/i18n/sv.po @@ -15034,7 +15034,7 @@ msgid "" msgstr "" msgid "" -"``allow_archive``\n" +"``allow-archive``\n" " List of archive format (bz2, gz, zip) allowed for downloading.\n" " Default is empty." msgstr "" diff --git a/mercurial/configitems.py b/mercurial/configitems.py --- a/mercurial/configitems.py +++ b/mercurial/configitems.py @@ -1225,7 +1225,8 @@ coreconfigitem('web', 'accesslog', coreconfigitem('web', 'address', default='', ) -coreconfigitem('web', 'allow_archive', +coreconfigitem('web', 'allow-archive', + alias=[('web', 'allow_archive')], default=list, ) coreconfigitem('web', 'allow_read', diff --git a/mercurial/help/config.txt b/mercurial/help/config.txt --- a/mercurial/help/config.txt +++ b/mercurial/help/config.txt @@ -2329,7 +2329,7 @@ The full set of options is: ``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 --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py --- a/mercurial/hgweb/webcommands.py +++ b/mercurial/hgweb/webcommands.py @@ -1162,7 +1162,7 @@ def archive(web): """ 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 --git a/mercurial/hgweb/webutil.py b/mercurial/hgweb/webutil.py --- a/mercurial/hgweb/webutil.py +++ b/mercurial/hgweb/webutil.py @@ -51,7 +51,7 @@ archivespecs = util.sortdict(( )) 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 --git a/tests/test-archive.t b/tests/test-archive.t --- a/tests/test-archive.t +++ b/tests/test-archive.t @@ -94,7 +94,7 @@ hg subrepos are shared into existence on $ 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 @@ check http return codes (with deprecated 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 --git a/tests/test-hgweb-json.t b/tests/test-hgweb-json.t --- a/tests/test-hgweb-json.t +++ b/tests/test-hgweb-json.t @@ -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 --git a/tests/test-hgweb-symrev.t b/tests/test-hgweb-symrev.t --- a/tests/test-hgweb-symrev.t +++ b/tests/test-hgweb-symrev.t @@ -30,7 +30,7 @@ Set up the repo | 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 --git a/tests/test-largefiles-wireproto.t b/tests/test-largefiles-wireproto.t --- a/tests/test-largefiles-wireproto.t +++ b/tests/test-largefiles-wireproto.t @@ -26,7 +26,7 @@ of largefiles. > patterns=glob:**.dat > usercache=${USERCACHE} > [web] - > allow_archive = zip + > allow-archive = zip > [hooks] > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status" > EOF