Discussion:
RFR : 8059000 : hgforest: pass options to serve command
Mike Duigou
2014-09-23 23:35:44 UTC
Permalink
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
Magnus Ihse Bursie
2014-09-24 08:19:27 UTC
Permalink
Post by Mike Duigou
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
Looks good to me.

/Magnus
Post by Mike Duigou
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 &
) &
else
pointo1d
2014-09-24 11:59:36 UTC
Permalink
Hiya Mike ,
Post by Mike Duigou
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 &
) &
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 ...
--
?Dave Pointon FIAP MBCS - Contractor engaged by IBM

Now I saw, tho' too late, the folly of beginning a work before we count the cost and
before we we judge rightly of our strength to go thro' with it - Robinson Crusoe
Mike Duigou
2014-09-24 20:14:11 UTC
Permalink
Post by pointo1d
Hiya Mike ,
Post by Mike Duigou
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 &
) &
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

Loading...