A year ago, I wrote about adding a user (global) hgignore file, which is very helpful for the general development environment, working well for favorite editor or developers personal taste of chosen tools. For example, Vims swap file or other tools temporary or configuration files.
But its still not enough. I have a project using API, so I would have to do some live test. In order to do that, I create a directory within the repository, which isnt suitable to be added to user (~/.hgignore) or repository (/path/to/repo/.hgignore) hgignore files. Because the directory name is just a random pick and the content of the directory is also random stuff, its not some rigorous test like unit test.
After digging into hgrc(5), I learned you can add as many as you like in user (~/.hgrc) and repository (.hg/hgrc) configuration files under the [ui] section like:
[ui] ignore.local = .hgignore.local ignore.outside = ~/somewhere/.hgignore
The local and outside are freely chosen, you can name whatever you like. When its relative path set in repositorys configuration file, its based off the root of repository as you can see in local hgignore.
In this .hgignore.local, it could be like:
syntax: glob .hgignore.local more patterns here
It ignores itself, so it wouldnt be accidentally committed into the repository as it shouldnt be.
0 comments:
Post a Comment