For a more general solution, ask Mercurial which files it ignores:
$ hg status --ignored
You can conclude that it is safe for xargs consumption:
$ hg status --ignored --no-status -0 | xargs -0 -delete
( -0 it is important to handle files with spaces in the name.) You can set this as a hook after updating:
[hooks] post-update = hg status
Finally, Mercurial comes with a purge extension that does something like this:
$ hg purge
will delete both unprocessed and ignored files. If everything is fine with the loss of irreproducible files, this command is probably the easiest for you, in particular because it also works on Windows, where xargs can be hard to find.
Martin geisler
source share