Mercurial - Custom Ignore File

I am trying to get mercurial to ignore hidden files for a specific user. I used the following directions here:

How to make mercurial ignore all hidden files?

and made him ignore files in a specific repo. I want to extend this behavior to all hg repositories for a specific user.

The hgrc man page says that you can link a specific user ignore file (e.g. ~ / .hgignore) by including something like this in your ~ / .hgrc:

[ui] username = Some User < user@email.com > ignore = ~/.hgignore 

but this does not seem to work.

I also tried

 ignore = /home/someuser/.hgignore ignore = $HOME/.hgignore ignore = ~/.hgignore2 

But that doesn't work either. Am I missing something? I cannot find anything on the Mercurial site or anywhere else. Please help, thanks.

** EDIT - I am on Linux. hg showconfig indicates that hg correctly reads my .hgrc file, the ignore behavior described in it does not work.

** EDIT2 - I also tried restarting my machine to see if it would change anything. This is not true.

+4
source share
1 answer

You do not need to specify ~ / .hgignore. It is automatically applied after the hgignore system and before the hgignore repo.

I use a lot of ignore files in ~/.hgrc without problems with hg 1.5 on linux.

 [ui] ignore = /home/geoffz/bin/hgext/hgignore ignore.local = /home/geoffz/bin/hgext/hgignore.local ignore.java = /home/geoffz/bin/hgext/hgignore.java 

Create a trivial repo with several files that you want to ignore, set up ignore entries and do hg st -A . If these files are shown as ? and not I , you have a serious problem in configuring hg / linux.

+7
source

Source: https://habr.com/ru/post/1315571/


All Articles