run-tests: Pass arguments into argument parser

Before, arguments were not passed into the optparse.OptionParser
instance and were coming from sys.argv. This patch enables consumers to
define the list of arguments to parse without having to adjust sys.argv.

--HG--
extra : rebase_source : 049d192c18c1d53ce7a49a179a6d9a2dd3e716ec
run-tests: use return values instead of sys.exit

--HG--
extra : rebase_source : 84d3451fc8c3f62b2d6e497dad5df921a3bc4617
run-tests: allow option parser to be extended

This patch moves the OptionParser population into its own function so
consumers may modify the OptionParser before arguments are evaluated.
This will allow consumers to add custom options, set different defaults,
etc.

--HG--
extra : rebase_source : 727ec3c9b6131fc200239895478e57967f19ad40
run-tests: allow test paths in other directories

Previously, test paths were assumed to be in the same directory and
wouldn't have a directory component. If a path with a directory
component was specified, it would be filtered out. This change allow
paths to contain directories. This in turn allows tests from other
directories to be executed.

Executing tests in other directories may break assumptions elsewhere in
the testing code. However, on initial glance, things appear to "just
work." This approach of running tests from other directories is
successfully being used at
https://hg.mozilla.org/hgcustom/version-control-tools/file/7085790ff3af/run-mercurial-tests.py

--HG--
extra : rebase_source : 9ce75a5990b3e18bef7ae2a10f90698c4b68abba
phase: add a passing test for (issue3575)

Apparently this issue was fixed along the way (If it ever existed at all…)

--HG--
extra : rebase_source : 0bc633aaa338715dc7620d479b60de048c90b839
grep: highlight all matched words

"hg grep" highlights first matched word only.
This behavior is different from GNU grep.

This patch makes highlight all matched words.

--HG--
extra : rebase_source : 5014f985305ab64aa8df97fe1b5546ff89fd5b87