diff contrib/chg/README @ 45551:4c8d9b53b1c7

chg: make is possible to call by default an hg binary located next to chg When a single version of hg is in use and it's in the PATH, using chg is just a matter of calling chg. But when there are multiple installations of hg+chg around, and hg is referred to with an absolute path, using chg is more annoying because it requires both changing the invocation to hg to use chg, but also setting CHGHG. Currently, we set HGPATH when we build chg to remove the need to set CHGHG in the previous paragraph. But that means chg now hardcodes its installation path, which makes the installation not relocatable. Hence this proposal to make chg find ./hg relative to itself (as opposed to CHGHG=./hg which find hg relative to cwd). This only works on linux as written, but since it's opt-in, it sounds fine. Tested by hand, as I'm not sure how else to test this. Differential Revision: https://phab.mercurial-scm.org/D9006
author Valentin Gatien-Baron <vgatien-baron@janestreet.com>
date Thu, 03 Sep 2020 11:07:47 -0400
parents 66d41c9e9222
children
line wrap: on
line diff
--- a/contrib/chg/README	Wed Sep 23 14:44:21 2020 +0200
+++ b/contrib/chg/README	Thu Sep 03 11:07:47 2020 -0400
@@ -30,3 +30,11 @@
  * CHGSOCKNAME specifies the socket path of the background cmdserver.
  * CHGTIMEOUT specifies how many seconds chg will wait before giving up
    connecting to a cmdserver. If it is 0, chg will wait forever. Default: 60
+
+Build environment variables:
+
+ * HGPATH: the path to the hg executable to call when CHGHG and HG are not set,
+   instead of "hg"
+ * HGPATHREL=1: when CHGHG and HG are not set, the hg executable will be ./hg
+   relative to the chg executable. Only works on linux, falls back to "hg"
+   otherwise.