On Sep 24 2014, at 04:59 , pointo1d <point...@gmail.com> wrote:

> Hiya Mike ,
> On 24/09/14 00:35, Mike Duigou wrote:
>> Hello all;
>> 
>> This is a one line change to the hgforest command to pass the command line 
>> options to the serve command. This is mostly useful for passing --port option
>> 
>> https://bugs.openjdk.java.net/browse/JDK-8059000
>> 
>> Mike
>> 
>> diff --git a/common/bin/hgforest.sh b/common/bin/hgforest.sh
>> --- a/common/bin/hgforest.sh
>> +++ b/common/bin/hgforest.sh
>> @@ -297,7 +297,7 @@ if [ "${command}" = "serve" ] ; then
>>        echo "serving root repo ${serving}" > ${status_output}
>>          echo "hg${global_opts} serve" > ${status_output}
>> -      (PYTHONUNBUFFERED=true hg${global_opts} serve -A ${status_output} -E 
>> ${status_output} --pid-file ${tmp}/serve.pid --web-conf 
>> ${tmp}/serve.web-conf; echo "$?" > ${tmp}/serve.pid.rc ) 2>&1 &
>> +      (PYTHONUNBUFFERED=true hg${global_opts} serve -A ${status_output} -E 
>> ${status_output} --pid-file ${tmp}/serve.pid --web-conf 
>> ${tmp}/serve.web-conf ${command_args}; echo "$?" > ${tmp}/serve.pid.rc ) 
>> 2>&1 &
>>      ) 2>&1 | sed -e "s@^@serve:   @" > ${status_output}
>>    ) &
>>  else
>> 
> As a non-reviewer, it looks good, but I would ask whether 'hg${global_opts}' 
> would be better written as 'hg ${global_opts' i.e. with the additional 
> whitespace between the hg command and any global options ? Just a thought ...

The global_opts variable is specifically constructed with leadings spaces for 
each option added. This allows options to be appended safely and doesn't result 
in extra whitespace in the commandline that is echoed. Yes, it is slightly odd.

Mike

Reply via email to