[PATCH 4 of 4] windows: replace single quote with double quote when translating to cmd.exe

Matt Harbison mharbison72 at gmail.com
Tue Jul 10 15:02:42 UTC 2018


> On Jul 10, 2018, at 8:43 AM, Yuya Nishihara <yuya at tcha.org> wrote:
> 
>> On Mon, 09 Jul 2018 11:27:47 -0400, Matt Harbison wrote:
>> # HG changeset patch
>> # User Matt Harbison <matt_harbison at yahoo.com>
>> # Date 1531026341 14400
>> #      Sun Jul 08 01:05:41 2018 -0400
>> # Node ID 53901aad0dbbf6d194a502ec437e4ef7d285e3fe
>> # Parent  6c1736648339979cd4950d435cd696f0d4a4a186
>> windows: replace single quote with double quote when translating to cmd.exe
>> 
>> Since cmd.exe doesn't understand single quotes, single quotes to prevent $var
>> expansion is basically unusable without this.
> 
> What if a user expects <'> will be passed as <'> itself?
> 
> I think it's okay to enable the $var translation by default because it's limited
> to the set of the known variable names, but for <'>, there's nothing to prevent
> unexpected translation. If we want this, the "tonative" option should be off by
> default.

Since single quote isn’t allowed in a path name and isn’t recognized as a shell quote, I figured nobody would use it (except to run sh.exe, but that probably should disable translating anyway).

I’d also like to change ~/ to %USERPROFILE%/.  So if you think it’s a problem, I’m ok with defaulting to off.


More information about the Mercurial-devel mailing list