We currently use hg manifest and hg grep to list and locate files, but these are potentially much less efficient than using hg locate. Particularly:
RichardJ: hg locate "set:grep(lemons) and not binary()" --rev . may be an alternative
The hg manifest replacements are probably straightforward. We also get a --print0 flag out of this.