Patchwork [1,of,2] config: rename allowpull to allow-pull

login
register
mail settings
Submitter David Demelier
Date Nov. 10, 2017, 2:09 p.m.
Message ID <4157480049dabdf7bd54.1510322961@sbr>
Download mbox | patch
Permalink /patch/25460/
State Accepted
Headers show

Comments

David Demelier - Nov. 10, 2017, 2:09 p.m.
# HG changeset patch
# User David Demelier <markand@malikania.fr>
# Date 1508406199 -7200
#      Thu Oct 19 11:43:19 2017 +0200
# Node ID 4157480049dabdf7bd54160c909baf13ea8d5107
# Parent  407ec7f3ff02ae357074104fe892adc2b12b42a7
config: rename allowpull to allow-pull

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
Yuya Nishihara - Nov. 12, 2017, 8:16 a.m.
On Fri, 10 Nov 2017 15:09:21 +0100, David Demelier wrote:
> # HG changeset patch
> # User David Demelier <markand@malikania.fr>
> # Date 1508406199 -7200
> #      Thu Oct 19 11:43:19 2017 +0200
> # Node ID 4157480049dabdf7bd54160c909baf13ea8d5107
> # Parent  407ec7f3ff02ae357074104fe892adc2b12b42a7
> config: rename allowpull to allow-pull
> 
> 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

Are we agreed to do that for all config options? or is it only for allowpull
and allowpush?

> diff -r 407ec7f3ff02 -r 4157480049da mercurial/help/config.txt
> --- a/mercurial/help/config.txt	Tue Nov 07 13:48:33 2017 -0800
> +++ b/mercurial/help/config.txt	Thu Oct 19 11:43:19 2017 +0200
> @@ -2287,7 +2287,7 @@
>      revisions.
>      (default: False)
>  
> -``allowpull``
> +``allow-pull``
>      Whether to allow pulling from the repository. (default: True)

Nit: Perhaps we should list the deprecated name as well.
Yuya Nishihara - Nov. 12, 2017, 9:43 a.m.
(+CC the list)

On Sun, 12 Nov 2017 10:05:07 +0100, David Demelier wrote:
> On Sun, Nov 12, 2017 at 05:16:06PM +0900, Yuya Nishihara wrote:
> > > diff -r 407ec7f3ff02 -r 4157480049da mercurial/help/config.txt
> > > --- a/mercurial/help/config.txt	Tue Nov 07 13:48:33 2017 -0800
> > > +++ b/mercurial/help/config.txt	Thu Oct 19 11:43:19 2017 +0200
> > > @@ -2287,7 +2287,7 @@
> > >      revisions.
> > >      (default: False)
> > >  
> > > -``allowpull``
> > > +``allow-pull``
> > >      Whether to allow pulling from the repository. (default: True)
> > 
> > Nit: Perhaps we should list the deprecated name as well.
> > 
> 
> Something like this?
> 
>     allow-pull (formerly allowpull)

Yeah, something like that. It would be nice if we could list more than one
terms, but our rst renderer appears to not support it.

  ``allow-pull``
  ``allowpull`` (DEPRECATED)
    blah blah...

Patch

diff -r 407ec7f3ff02 -r 4157480049da mercurial/configitems.py
--- a/mercurial/configitems.py	Tue Nov 07 13:48:33 2017 -0800
+++ b/mercurial/configitems.py	Thu Oct 19 11:43:19 2017 +0200
@@ -1006,7 +1006,8 @@ 
 coreconfigitem('web', 'allowgz',
     default=False,
 )
-coreconfigitem('web', 'allowpull',
+coreconfigitem('web', 'allow-pull',
+    alias=[('web', 'allowpull')],
     default=True,
 )
 coreconfigitem('web', 'allow_push',
diff -r 407ec7f3ff02 -r 4157480049da mercurial/help/config.txt
--- a/mercurial/help/config.txt	Tue Nov 07 13:48:33 2017 -0800
+++ b/mercurial/help/config.txt	Thu Oct 19 11:43:19 2017 +0200
@@ -2287,7 +2287,7 @@ 
     revisions.
     (default: False)
 
-``allowpull``
+``allow-pull``
     Whether to allow pulling from the repository. (default: True)
 
 ``allow_push``
diff -r 407ec7f3ff02 -r 4157480049da mercurial/hgweb/hgweb_mod.py
--- a/mercurial/hgweb/hgweb_mod.py	Tue Nov 07 13:48:33 2017 -0800
+++ b/mercurial/hgweb/hgweb_mod.py	Thu Oct 19 11:43:19 2017 +0200
@@ -114,7 +114,7 @@ 
         self.stripecount = self.configint('web', 'stripes')
         self.maxshortchanges = self.configint('web', 'maxshortchanges')
         self.maxfiles = self.configint('web', 'maxfiles')
-        self.allowpull = self.configbool('web', 'allowpull')
+        self.allowpull = self.configbool('web', 'allow-pull')
 
         # we use untrusted=False to prevent a repo owner from using
         # web.templates in .hg/hgrc to get access to any file readable