Also handle multiple occurrences of the same line by storing
linestates in an array instead of a dict, and using difflib
to compute the difference between linestates.
We want to reserve -e for future use and grep compatibility.
I've changed every-match to all out of a general preference for
shorter long option names where short options don't exist.
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.