user276648
user276648

Reputation: 6383

How to ignore hgignore when reverting (aka remove all useless files)

I have a .hgignore file that works great for hiding all the files and directories creating when compiling my C# projects.

Now when doing a "revert" to a previous revision, I would also like to clean up my working directory, ie remove all the exes and dlls that I've previously compiled (as I may end up using the wrong version of an exe or dll without realizing it).

Is there a way to do that (kind of ignoring .hgignore somehow)? Right now I'm just removing all bin and obj directories, but maybe Hg can also do it...

Upvotes: 0

Views: 429

Answers (2)

Ry4an Brase
Ry4an Brase

Reputation: 78350

Rudi's answer is best, but if you don't want to install an extension you can always do:

hg status -nu0 | xargs -0 rm -v

which does the same thing. (Optionally include i in the options for status to get ignored files too.

Upvotes: 2

Rudi
Rudi

Reputation: 19950

You are looking for the purge extension.

Upvotes: 5

Related Questions