Roberto Aloi
Roberto Aloi

Reputation: 30985

About Mercurial, .hgignore file and glob syntax

Is it possible, while using glob syntax for an .hgignore file, to recursively ignore certain files and folders, except one?

Assuming that you have:

a/
a/b
a/c
a/d

Something like:

syntax globe:
a
^a/b

This should ideally ignore c and d and keep b.

I know this has been discussed in other SO questions, but it seems they're all using regex mode for the syntax.

Upvotes: 0

Views: 4257

Answers (2)

Ry4an Brase
Ry4an Brase

Reputation: 78330

If you want to ignore all but one, just add that one. Adding a file overrides ignoring it, which differs from subversion or cvs, but is incredibly handy.

Upvotes: 3

Otto Allmendinger
Otto Allmendinger

Reputation: 28268

The glob syntax is transformed to regex in match.py. It seems that this is the syntax you are looking for:

syntax:glob

a/*[!b]

Upvotes: 2

Related Questions