nhrobin
nhrobin

Reputation: 903

How to exclude a specific folder from ignored list in .hgignore

I have some temp folders in my source tree. I am ignoring them all in .hgignore like below

temp/

It is ignoring all the temp folders e.g.

a/temp
b/temp
a/c/temp
b/d/temp

But I want a specific temp folder for example "a/c/temp" to include in the repository. So I excluded it in .hgignore like below.

!a/c/temp
/temp

But it is not working. "a/c/temp" folder is still being ignored. Any idea?

Upvotes: 2

Views: 1278

Answers (1)

sotcha
sotcha

Reputation: 923

You need something like that (Negative Lookahead):

syntax: regexp
^(?!a/c).*/temp

and if you want to exlude more directories, for example b/d/temp

syntax: regexp
^(?!a/c|b/d).*/temp

I hope that helps.

Upvotes: 3

Related Questions