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.
#header#
# HG changeset patch
# User #author#
# Date #date|date#
# Node ID #node#
#parent#
#desc#
#diff#