comparison tests/test-https.t @ 30234:34a5f6c66bc5 stable

tests: invoke printenv.py via sh -c for test portability On Windows platform, invoking printenv.py directly via hook is problematic, because: - unless binding between *.py suffix and python runtime, application selector dialog is displayed, and running test is blocked at each printenv.py invocations - it isn't safe to assume binding between *.py suffix and python runtime, because application binding is easily broken For example, installing IDE (VisualStudio with Python Tools, or so) often requires binding between source files and IDE itself. This patch invokes printenv.py via sh -c for test portability. This is a kind of follow up for d19787db6fe0, which eliminated explicit "python" for printenv.py. There are already other 'sh -c "printenv.py"' in *.t files, and this fix should be reasonable. This changes were confirmed in cases below: - without any application binding for *.py suffix - with binding between *.py suffix and VisualStudio This patch also replaces "echo + redirection" style with "heredoc" style, because: - hook command line is parsed by cmd.exe as shell at first, and - single quotation can't quote arguments on cmd.exe, therefore, - "printenv.py foobar" should be quoted by double quotation, but - nested quoting (or tricky escaping) isn't readable
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Sat, 29 Oct 2016 02:44:45 +0900
parents d5497eb1d768
children 318a24b52eeb
comparison
equal deleted inserted replaced
30233:3afde791dce1 30234:34a5f6c66bc5
201 $ cd .. 201 $ cd ..
202 202
203 pull without cacert 203 pull without cacert
204 204
205 $ cd copy-pull 205 $ cd copy-pull
206 $ echo '[hooks]' >> .hg/hgrc 206 $ cat >> .hg/hgrc <<EOF
207 $ echo "changegroup = printenv.py changegroup" >> .hg/hgrc 207 > [hooks]
208 > changegroup = sh -c "printenv.py changegroup"
209 > EOF
208 $ hg pull $DISABLECACERTS 210 $ hg pull $DISABLECACERTS
209 pulling from https://localhost:$HGPORT/ 211 pulling from https://localhost:$HGPORT/
210 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?) 212 warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
211 abort: unable to verify security of localhost (no loaded CA certificates); refusing to connect 213 abort: unable to verify security of localhost (no loaded CA certificates); refusing to connect
212 (see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this error or set hostsecurity.localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e to trust this server) 214 (see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this error or set hostsecurity.localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e to trust this server)