1

I want to use a special extension, but for certain reasons I want to avoid to modify my Mercurial installation and touch existing Mercurial.ini or .hg/hgrc files. Usually, I invoke a command like

hg --config extensions.hgext.foo=c:\path\to\my\extension.py ...

If I would write just

hg --config extensions.hgext.foo=extension.py ...

where Mercurial would search for extension.py? Is there a way to configure an environment variable where I can add/set c:\path\to\my path, so Mercurial would find extensions.py without specifying the full path?

Thomas S.
  • 5,804
  • 5
  • 37
  • 72

1 Answers1

0

Assuming you are using the windows cmd line interface, you could wrap the entire config line into the cmd window's local environment var:

SET enablefoo=--config extensions.hgext.foo=c:\path\to\my\extension.py

Then you could turn it on for any given command by:

hg %enablefoo% foo -r tip

Note that this is using the local environment variable to do some inline substituion before hg is called; hg is not affected or altered at all and isn't "searching" for anything.

Edward
  • 3,292
  • 1
  • 27
  • 38