grep: extend functionality, add man page entry, add unit test.
walkchangerevs now returns a two-tuple. Its behaviour is also
extensively commented.
The annotate command's getname function has been factored out to a new
function, trimname, so it can be shared between annotate and grep.
The behaviour of grep has been beefed up, so that it now performs a
number of useful functions.
\.elc$
\.orig$
\.rej$
~$
\.so$
\.pyc$
\.swp$
\.prof$
^tests/.*\.err$
^build/
^dist/
^doc/.*\.[0-9](\.(x|ht)ml)?$
^MANIFEST$
^\.pc/
^patches/
^mercurial/__version__.py$