Ignoring anything but a subfolder in Mercurial

I want to ignore all BUT subfolders in Mercurial.

Folder I want to save:

a/b/c/d/e/f

All the rest:

a/b

It should be ignored.

I am using regexp mode in a .hgignore file. This is what I still have:

a/b/(?!c)
a/b/c/(?!d)
a/b/c/d/(?!e)
a/b/c/d/e/(?!f)

Even if this works well, I would like to compress it to one line:

a/b/(?!c/d/e/f)

Also, this does not work. I tried to avoid the slash in several ways, but that didn't help.

Any clues?

+3
source share
4 answers

Have you tried this:

a/b/(?!c).*
+1
source

, , a/b/c/d/e/f, .hgignore. , , , , , CVS/SVN.

+1
^a/b/(?!c/d/e/f).*$
0
source

Why not just create an hg repo in a / b / c / d / e / f?

0
source

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


All Articles