views:

797

answers:

2

You can use hg grep, but it searches the contents of all files.

What if I just want to search the file names of deleted files to recover one?

I tried hg grep -I file-name-pattern pattern but this seems to return no results.

+7  A: 

using templates is simple:

$ hg log --template "{rev}: {file_dels}\n"
dfa
I hadn't seen this but you can imagine how it is not exactly "quick" when you have a repository with thousands of revisions and thousands of file deletions.
wsorenson
it doesn't grep contents, it only checks metadata
dfa
A minor tweak to get rid of commits where no deletion happend: hg log --template "{rev}: {file_dels}\n" | grep -v ':\s*$'
Peter Rowell
I use this all the time now, I wish I could vote you up more
Frank Krueger
+2  A: 

Update for Mercurial 1.6

You can use revsets for this too:

hg log -r "removes('*')"

Take a look at hg help revsets for the rest of the query language.

shambulator