Fix issues with trailing slashes and hg-history for HgWebClient.
Fix issues with trailing slashes and hg-history for HgWebClient.

The "hg-history" branch of the HgWeb implementation could strip off too much
stuff if people forgot to configure their server name with a trailing slash.
I've simplified the code and fixed the bug all in one go. Trivial change.

Testing done: Ran unit tests.

Fixes bug 3216.

reviewboard/reviewboard,sgallagher/reviewboard,sgallagher/reviewboard,1tush/reviewboard,custode/reviewboard,1tush/reviewboard,brennie/reviewboard,brennie/reviewboard,davidt/reviewboard,1tush/reviewboard,chipx86/reviewboard,bkochendorfer/reviewboard,davidt/reviewboard,KnowNo/reviewboard,1tush/reviewboard,custode/reviewboard,1tush/reviewboard,chipx86/reviewboard,sgallagher/reviewboard,bkochendorfer/reviewboard,brennie/reviewboard,sgallagher/reviewboard,beol/reviewboard,reviewboard/reviewboard,davidt/reviewboard,KnowNo/reviewboard,beol/reviewboard,chipx86/reviewboard,chipx86/reviewboard,custode/reviewboard,1tush/reviewboard,bkochendorfer/reviewboard,beol/reviewboard,1tush/reviewboard,1tush/reviewboard,beol/reviewboard,reviewboard/reviewboard,bkochendorfer/reviewboard,brennie/reviewboard,KnowNo/reviewboard,davidt/reviewboard,KnowNo/reviewboard,custode/reviewboard,1tush/reviewboard,reviewboard/reviewboard