Patchwork sshpeer: move docstring to top

login
register
mail settings
Submitter Yuya Nishihara
Date Dec. 19, 2017, 2:37 p.m.
Message ID <c836f3fd99ec97b24843.1513694238@mimosa>
Download mbox | patch
Permalink /patch/26364/
State Accepted
Headers show

Comments

Yuya Nishihara - Dec. 19, 2017, 2:37 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1513599353 -32400
#      Mon Dec 18 21:15:53 2017 +0900
# Node ID c836f3fd99ec97b248434e1523c73d77066c1d43
# Parent  44fd4cfc6c0ad3107cacad10c76ed38bd74948f4
sshpeer: move docstring to top

Also makes it use double quotes consistently.
Augie Fackler - Dec. 20, 2017, 3:31 a.m.
> On Dec 19, 2017, at 09:37, Yuya Nishihara <yuya@tcha.org> wrote:
> 
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1513599353 -32400
> #      Mon Dec 18 21:15:53 2017 +0900
> # Node ID c836f3fd99ec97b248434e1523c73d77066c1d43
> # Parent  44fd4cfc6c0ad3107cacad10c76ed38bd74948f4
> sshpeer: move docstring to top

hah, queued, thanks


> Also makes it use double quotes consistently.
> 
> diff --git a/mercurial/sshpeer.py b/mercurial/sshpeer.py
> --- a/mercurial/sshpeer.py
> +++ b/mercurial/sshpeer.py
> @@ -18,9 +18,9 @@ from . import (
> )
> 
> def _serverquote(s):
> +    """quote a string for the remote shell ... which we assume is sh"""
>     if not s:
>         return s
> -    '''quote a string for the remote shell ... which we assume is sh'''
>     if re.match('[a-zA-Z0-9@%_+=:,./-]*$', s):
>         return s
>     return "'%s'" % s.replace("'", "'\\''")
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

diff --git a/mercurial/sshpeer.py b/mercurial/sshpeer.py
--- a/mercurial/sshpeer.py
+++ b/mercurial/sshpeer.py
@@ -18,9 +18,9 @@  from . import (
 )
 
 def _serverquote(s):
+    """quote a string for the remote shell ... which we assume is sh"""
     if not s:
         return s
-    '''quote a string for the remote shell ... which we assume is sh'''
     if re.match('[a-zA-Z0-9@%_+=:,./-]*$', s):
         return s
     return "'%s'" % s.replace("'", "'\\''")