revlog: add incancestors, a version of ancestors that includes revs listed

ancestors() returns the ancestors of revs provided. This func is like
that except it also includes the revs themselves in the total set of
revs generated.
revlog: remove reachable and switch call sites to ancestors

This change does a trivial conversion of callsites to ancestors.
Followon diffs will switch the callsites over to revs.
transplant: convert applied() algorithm from nodes to revs

After a recent switch from revlog.reachable to revlog.ancestors,
clean up the code a bit to use revs rather than nodes.
discovery: convert legacy part of checkheads to revs from nodes

After a recent switch from revlog.reachable to revlog.ancestors,
clean up this old call site, switching it from nodes to revs.
localrepo: convert _updatebranchcache from nodespace to revspace

_updatebranchcache used to use revlog.reachable.  After the switch to
revlog.ancestors, we can now clean it up a bit and switch the algorithm from
nodes to revs.
strip: incrementally update the branchheads cache after a strip

This function augments strip to incrementally update the branchheads cache
rather than recompute it from scratch.  This speeds up the performance of strip
and rebase on repos with long history.  The performance optimization only
happens if the revisions stripped are all on the same branch and the parents of
the stripped revisions are also on that same branch.

This adds a few test cases, particularly one that reproduces the extra heads
that mpm observed.
subrepo: warn user if Git is not version 1.6.0 or higher

--HG--
branch : stable
subrepo: support Git being named "git.cmd" on Windows (issue3173)

Popen does not consider "foo.cmd" equivalent to "foo" on Windows.
Unfortunately, the default MSYS Git installation installs only "git.cmd" into
the path by default.  This patch probes for both possible names on Windows.

--HG--
branch : stable
rebase: improve error message on improper phases

The previous error message had two issues: The first issue was that it
wasn't, in fact, an error but a warning, even though it described a
fatal error condition preventing the successful completion of the
command. The second was that it didn't mention the immutable
changesets, leaving the user guessing at the true cause of the error.

The main downside to this change is that we now get an 'abort: can't
abort...' message which technically contradicts itself. In this case,
I blame that on the two uses we have for the word; if it weren't for
backwards compatibility, we could make util.Abort print out 'error:
<whatever>'.

--HG--
branch : stable
tests: convert some 'hghave no-outer-repo' to #if

In some places we instead use 'hg init' to create a well-known outer repo
without any special extensions or other config settings.
tests: add missing no-outer-repo requirements

Outer repos (if any) will now never be touched by the tests. But it is better
to run without any repos around the tmp directory.
tests: hghave outer-repo should be true even if a bad repo is found

Only the abort message 'no repository found' is a reliable indication that
there is no outer repo.
tests: prepare get-with-headers.py for MSYS

get-with-headers.py took the http GET parameter as a command line parameter
that had to start with '/'. MSYS on windows will mangle such paths.

Instead of applying a workaround everywhere (such as an extra '/') we let
get-with-headers.py add the mandatory '/'. That is consistent with the
url path handling in the Mercurial url class.

A few tests sent 'GET ?cmd=...' which is invalid. They will now send 'GET
/?cmd=...'.

This will not enable any tests for being run on windows - only remove one
reason they were disabled.
tests: consistently use printenv.py the same MSYS/Windows-compatible way

This will remove some reasons some tests are disabled on Windows.
test-bad-pull: partially adjust for Windows

On a English Windows 7, the testcase fails with

  $ hg clone http://localhost:$HGPORT/ copy
  abort: error: No connection could be made because the target machine actively refused it

Since the error message on non-English Windows installs are most likely
different, we have to glob the entire error message away for Windows.
test-static-http: partially adapt for Windows
test-bookmarks-pushpull: partially adapt for Windows

The kill call at the end is redundant, as we already have

199:  $ hg serve -p $HGPORT -d --pid-file=../hg.pid -E errors.log
200:  $ cat ../hg.pid >> $DAEMON_PIDS

So there is nothing left that would not already be killed by the $DAEMON_PIDS
mechanism.
test-subrepo-git.t: adapt for Windows

hg forget 'notafile*' is changed to use a name that is valid on Windows so we
still get the same error ... but the error message is disabled because it
varies with the Windows version.
test-http and test-https: partially adapt for Windows
merge with stable