[PATCH] editmerge: dequote other use of $ED

Yuya Nishihara yuya at tcha.org
Tue Oct 20 08:20:51 CDT 2015


On Mon, 19 Oct 2015 21:36:20 -0700, Ryan McElroy wrote:
> # HG changeset patch
> # User Ryan McElroy <rmcelroy at fb.com>
> # Date 1445315772 25200
> #      Mon Oct 19 21:36:12 2015 -0700
> # Node ID c5029d29d91b306f0a41d1ae104004c2d8550aca
> # Parent  cbd04ce641b943ee40b2355b81fc910a7c7a4a88
> editmerge: dequote other use of $ED
> 
> We want to support editors with parameters, eg EDITOR="vim -O" or whatever.
> So remove the quotes from around $ED and assume that the editor variable is
> properly escaped already.
> 
> diff --git a/contrib/editmerge b/contrib/editmerge
> --- a/contrib/editmerge
> +++ b/contrib/editmerge
> @@ -40,7 +40,7 @@ if [ "$ED" = "emacs" ] || [ "$ED" = "nan
>    # open the editor to the first conflict until there are no more
>    # or the user stops editing the file
>    while [ ! "$FIRSTLINE" = "" ] && [ ! "$FIRSTLINE" = "$PREVIOUSLINE" ] ; do
> -    "$ED" "+$FIRSTLINE" "$FILE"
> +    $ED "+$FIRSTLINE" "$FILE"

Looks good for consistency, though "$ED" is harmless here because it is
tested as [ "$ED" = "emacs" ] || [ "$ED" = "nano" ] || [ "$ED" = "vim" ].


More information about the Mercurial-devel mailing list