Patchwork config: rename streamunbundle to stream-unbundle

login
register
mail settings
Submitter David Demelier
Date May 14, 2018, 9:23 a.m.
Message ID <3cd7780897a23b96f6bb.1526289804@x1>
Download mbox | patch
Permalink /patch/31582/
State New
Headers show

Comments

David Demelier - May 14, 2018, 9:23 a.m.
# HG changeset patch
# User David Demelier <markand@malikania.fr>
# Date 1526286491 -7200
#      Mon May 14 10:28:11 2018 +0200
# Node ID 3cd7780897a23b96f6bbb5d5fccc2a3006931365
# Parent  8ba0344f9fb145f5b9b909f1211defc9e0793f68
config: rename streamunbundle to stream-unbundle

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 - May 14, 2018, 12:22 p.m.
On Mon, 14 May 2018 11:23:24 +0200, David Demelier wrote:
> # HG changeset patch
> # User David Demelier <markand@malikania.fr>
> # Date 1526286491 -7200
> #      Mon May 14 10:28:11 2018 +0200
> # Node ID 3cd7780897a23b96f6bbb5d5fccc2a3006931365
> # Parent  8ba0344f9fb145f5b9b909f1211defc9e0793f68
> config: rename streamunbundle to stream-unbundle
> 
> 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 3cd7780897a2 mercurial/configitems.py
> --- a/mercurial/configitems.py	Fri May 11 22:07:43 2018 -0400
> +++ b/mercurial/configitems.py	Mon May 14 10:28:11 2018 +0200
> @@ -932,7 +932,8 @@
>  coreconfigitem('server', 'disablefullbundle',
>      default=False,
>  )
> -coreconfigitem('server', 'streamunbundle',
> +coreconfigitem('server', 'stream-unbundle',
> +    alias=[('server', 'streamunbundle')],
>      default=False,

Let's not add more aliases for now. Someone will have to refactor the
ui.config* layer so the user server.streamunbundle will never be shadowed
by the system server.stream-unbundle.

Patch

diff -r 8ba0344f9fb1 -r 3cd7780897a2 mercurial/configitems.py
--- a/mercurial/configitems.py	Fri May 11 22:07:43 2018 -0400
+++ b/mercurial/configitems.py	Mon May 14 10:28:11 2018 +0200
@@ -932,7 +932,8 @@ 
 coreconfigitem('server', 'disablefullbundle',
     default=False,
 )
-coreconfigitem('server', 'streamunbundle',
+coreconfigitem('server', 'stream-unbundle',
+    alias=[('server', 'streamunbundle')],
     default=False,
 )
 coreconfigitem('server', 'pullbundle',
diff -r 8ba0344f9fb1 -r 3cd7780897a2 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 10:28:11 2018 +0200
@@ -1791,7 +1791,7 @@ 
     are highly recommended. Partial clones will still be allowed.
     (default: False)
 
-``streamunbundle``
+``stream-unbundle``
     When set, servers will apply data sent from the client directly,
     otherwise it will be written to a temporary file first. This option
     effectively prevents concurrent pushes.
diff -r 8ba0344f9fb1 -r 3cd7780897a2 mercurial/wireprotov1server.py
--- a/mercurial/wireprotov1server.py	Fri May 11 22:07:43 2018 -0400
+++ b/mercurial/wireprotov1server.py	Mon May 14 10:28:11 2018 +0200
@@ -553,7 +553,7 @@ 
             cleanup = lambda: None
             try:
                 payload = proto.getpayload()
-                if repo.ui.configbool('server', 'streamunbundle'):
+                if repo.ui.configbool('server', 'stream-unbundle'):
                     def cleanup():
                         # Ensure that the full payload is consumed, so
                         # that the connection doesn't contain trailing garbage.
diff -r 8ba0344f9fb1 -r 3cd7780897a2 tests/test-push-http.t
--- a/tests/test-push-http.t	Fri May 11 22:07:43 2018 -0400
+++ b/tests/test-push-http.t	Mon May 14 10:28:11 2018 +0200
@@ -97,7 +97,7 @@ 
   % serve errors
   $ hg rollback
   repository tip rolled back to revision 0 (undo serve)
-  $ req "--debug --config server.streamunbundle=True --config extensions.blackbox="
+  $ req "--debug --config server.stream-unbundle=True --config extensions.blackbox="
   listening at http://*:$HGPORT/ (bound to $LOCALIP:$HGPORT) (glob) (?)
   pushing to http://localhost:$HGPORT/
   searching for changes