Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mercurial: where to put the "style file" so it can (easily) be used on all my projects

Tags:

mercurial

Just learning about mercurial's --style and --template options that can be used on hg log and hg tip and I find them to be extremely helpful, but I can't figure out where to put my "style files"

I have a "style file" which will allow me to do a hg tip --style ./my-style — and it works great. Except that I don't want this style file to be a file under my project. And I want to be able to use it on all my projects. I don't want it to be the default style (so it isn't an option to update .hgrc's style field).

Where should I put this file? Do I just need to put in in my home directory and refer to it like hg tip --style ~/my-style?

Not sure if you need to know, but although I use Windows at times, I mostly use Linux.

like image 901
shaune Avatar asked Feb 23 '11 00:02

shaune


1 Answers

It doesn't really matter where you put it. I usually organize my hg-related files in a single directory in my home directory which I call ~/.hgstuff. I have an hgignore and some other common settings files in there.

You can also use the [alias] section to define aliases which will automatically apply your style file. Eg:

[alias]
stip = tip --style ~/.hgstuff/my-style

Then you just need to run hg stip to get your stylized version.

If you want to use the style for every command, you can set it in the [ui] section:

[ui]
style = ~/.hgstuff/my-style
like image 107
Kamil Kisiel Avatar answered Oct 05 '22 06:10

Kamil Kisiel