chg: extract gethgcmd logic to a function
gethgcmd is to get original hg (not chg) binary name. This patch extracts
the logic from execcmdserver to make it available for the following patch.
# This config file points Mercurial at the system-wide certificate
# store from the ca-certificates package.
[web]
cacerts = /etc/ssl/certs/ca-certificates.crt