Patchwork [clowncopter] commit: adjust the quoting in the examples to be Windows friendly

login
register
mail settings
Submitter Matt Harbison
Date Dec. 6, 2015, 4:23 a.m.
Message ID <8f7a64c53d0ebb9717c8.1449375803@Envy>
Download mbox | patch
Permalink /patch/11849/
State Accepted
Headers show

Comments

Matt Harbison - Dec. 6, 2015, 4:23 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1449371988 18000
#      Sat Dec 05 22:19:48 2015 -0500
# Node ID 8f7a64c53d0ebb9717c8e011f753c182e29b2320
# Parent  4af56d6452d5127db44bf946b5053582e16e49ba
commit: adjust the quoting in the examples to be Windows friendly

We should probably avoid strong quotes around command line args in the examples,
since cmd.exe doesn't recognize them, and it will surprise a user who cargo
cults them.  I don't see a way to make a rule for this, since strong quoting is
OK inside command line args, like within revsets.
Pierre-Yves David - Dec. 6, 2015, 4:47 a.m.
On 12/05/2015 08:23 PM, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison@yahoo.com>
> # Date 1449371988 18000
> #      Sat Dec 05 22:19:48 2015 -0500
> # Node ID 8f7a64c53d0ebb9717c8e011f753c182e29b2320
> # Parent  4af56d6452d5127db44bf946b5053582e16e49ba
> commit: adjust the quoting in the examples to be Windows friendly
>
> We should probably avoid strong quotes around command line args in the examples,
> since cmd.exe doesn't recognize them, and it will surprise a user who cargo
> cults them.  I don't see a way to make a rule for this, since strong quoting is
> OK inside command line args, like within revsets.

woops, pushed to the clowncopter.
Matt Harbison - Dec. 6, 2015, 4:54 a.m.
On Sat, 05 Dec 2015 23:47:30 -0500, Pierre-Yves David  
<pierre-yves.david@ens-lyon.org> wrote:

>
>
> On 12/05/2015 08:23 PM, Matt Harbison wrote:
>> # HG changeset patch
>> # User Matt Harbison <matt_harbison@yahoo.com>
>> # Date 1449371988 18000
>> #      Sat Dec 05 22:19:48 2015 -0500
>> # Node ID 8f7a64c53d0ebb9717c8e011f753c182e29b2320
>> # Parent  4af56d6452d5127db44bf946b5053582e16e49ba
>> commit: adjust the quoting in the examples to be Windows friendly
>>
>> We should probably avoid strong quotes around command line args in the  
>> examples,
>> since cmd.exe doesn't recognize them, and it will surprise a user who  
>> cargo
>> cults them.  I don't see a way to make a rule for this, since strong  
>> quoting is
>> OK inside command line args, like within revsets.
>
> woops, pushed to the clowncopter.

Is there a reasonable way to put in a rule for this?  I only noticed this  
because there's a test-gendoc failure associated with this new block of  
help (specifically the 'set:**.py' line).  I didn't exhaustively review  
everything else.  There seems to be a recent push to add examples to help,  
so it could be useful.
Pierre-Yves David - Dec. 6, 2015, 5:06 a.m.
On 12/05/2015 08:54 PM, Matt Harbison wrote:
> On Sat, 05 Dec 2015 23:47:30 -0500, Pierre-Yves David
> <pierre-yves.david@ens-lyon.org> wrote:
>
>>
>>
>> On 12/05/2015 08:23 PM, Matt Harbison wrote:
>>> # HG changeset patch
>>> # User Matt Harbison <matt_harbison@yahoo.com>
>>> # Date 1449371988 18000
>>> #      Sat Dec 05 22:19:48 2015 -0500
>>> # Node ID 8f7a64c53d0ebb9717c8e011f753c182e29b2320
>>> # Parent  4af56d6452d5127db44bf946b5053582e16e49ba
>>> commit: adjust the quoting in the examples to be Windows friendly
>>>
>>> We should probably avoid strong quotes around command line args in
>>> the examples,
>>> since cmd.exe doesn't recognize them, and it will surprise a user who
>>> cargo
>>> cults them.  I don't see a way to make a rule for this, since strong
>>> quoting is
>>> OK inside command line args, like within revsets.
>>
>> woops, pushed to the clowncopter.
>
> Is there a reasonable way to put in a rule for this?  I only noticed
> this because there's a test-gendoc failure associated with this new
> block of help (specifically the 'set:**.py' line).  I didn't
> exhaustively review everything else.  There seems to be a recent push to
> add examples to help, so it could be useful.

I do not see and obvious way to catch that. Do we have something to 
catch that in test? we could port it to help (maybe).

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -1592,11 +1592,11 @@ 
 
       - commit all files ending in .py:
 
-          hg commit --include 'set:**.py'
+          hg commit --include "set:**.py"
 
       - commit all non-binary files:
 
-          hg commit --exclude 'set:binary()'
+          hg commit --exclude "set:binary()"
 
       - amend the current commit and set the date to now: