tests: rewrite path in test-shelve.t for not being mangled on msys

msys (on windows) converets '-R bundle:.XX/XX' to '-R bundle:;.XX/XX'. Avoid
this by writing '-R bundle://.XX/XX'. This is used more often than the
alternative work arounds like '-Rbundle://.XX/XX' or '-R bundle:Y/../.XX/XX'.
revset: minor changes adding baseset to revsets

Changed bits of code to work with baseset implementations.
win32: spawndetached returns pid of detached process and not of cmd.exe

win32.spawndetached starts the detached process by `cmd.exe` (or COMSPEC). The
pid it returned was the one of cmd.exe and not the one of the detached process.
When this pid is used to kill the process, the detached process is not killed,
but only cmd.exe.

With this patch the pid of the detached process is written to the pid file.
Killing the process works as expected.

The pid is only evaluated on writing the pid file. It is unnecessary to search
the pid when it is not needed. And more important, it probably does not yet
exist right after the cmd.exe process was started. When the pid is written to
the file, waiting for the start of the detached process has already happened.
Use this functionality instead of writing a 2nd wait function.

Many tests on windows will not fail anymore, all those with the first failing
line "abort: child process failed to start". (The processes still hanging
around from previous test runs have to be killed first. They still block a
tcp port.)
A good test for the functionality of this patch is test-treediscovery.t,
because it starts and kills `hg serve -d` several times.
tests: test that the pid returned by `hg serve` looks reasonable

This failed on windows before win32.spawndetached has been fixed. The process
name was "cmd.exe" and not "hg.exe" or "python.exe".
revset: added lazyset class with basic operations

This class allows us to return values from large revsets as soon as they are
computed instead of having to wait for the entire revset to be calculated.
revset: added basic operations to lazyset

Added methods __add__, __sub__ and __and__ to duck type more methods in
baseset
revset: added operations to duck type baseset

Added more operations which are not lazy but only used so far to duck type
baseset.

Their implementations will be changed in future patches.
hooks: only disable/re-enable demandimport when it's already enabled

This fixes an issue introduced in d7c28954d901 where, when disabling
demandimport while running hooks, it's inadvertently re-enabled even when
it was never enabled in the first place.

This doesn't affect normal command line usage of Mercurial; it only matters
when Mercurial is run with demandimport intentionally disabled.

--HG--
branch : stable
merge with stable