extensions: use normpath to allow trailing '\' on Windows (issue4187)

Fixes same issue as 5c794e7331e7 but now works on Windows too.

With this patch a trailing backward slash won't prevent the extension from
being found on Windows, and we continue to support any combination of forward
and back slashes within the path.

--HG--
extra : rebase_source : a3ace3dbc7fc9ae6200df054fdb130d90b50bfda
extra : amend_source : dfd12cd88725ec416397d3ca38059100cdf3048b
localrepo: changed revs to use spanset instead of baseset

Performance benchmarking:

$ time hg log -qf -l1
...

real  0m1.420s
user  0m1.249s
sys 0m0.167s

$ time ~/local/hg/hg log -qf -l1
...

real  0m0.719s
user  0m0.614s
sys 0m0.103s
histedit: clean up lock imports

We are alread importing the release function from lock, no need
to actually import the module too.
histedit: move logic for finding child nodes to new function

This function will be used in later patches.
cmdserver: prepare test for starting server without repository
cmdserver: allow to start server without repository

Typical use case is to clone repository through command server.  Clone may
require user interaction, so command-server protocol is beneficial over
raw stdio channels.
merge: add blank line between mergestate's method

This class is now too big to be a single big block of continuous text.

--HG--
extra : rebase_source : 37d4c6705c2470d788ad9ed4af3d1d6f27400032
merge: adds documentation to the mergestate class

Document most the new function involved in the new serialisation process (and a
few others).

--HG--
extra : rebase_source : 27e41ab0ab5afc85d8a2a8382fec720d97f2ac9e