commands: don't infer repo for commands like update (issue2748)

Maintain a whitelist of commands to infer the repo for instead. The whitelist
contains those commands that take file(s) in the working dir as arguments.
obsolete: cheap detection of nullid as successors

Nullid as successors create multiple issues:

- Nullid revnum is -1, confusing algorithm that use revnum unless you add
  special handling in all of them.
- Nullid confuses "divergent" changeset detection and resolution. As you can't
  add any successors to Nullid without being in even more troubles

Fortunately, there is no good reason to use nullid as a successor. The only
sensible meaning of "succeed by nullid" is "dropped" and this meaning is already
covered by obsolescence marker with empty successors set.

However, letting some nullid successors to slip in may cause terrible damage in
such algorithm difficult to debug. So I prefer to perform and clear detection of
of such pathological changeset. We could be much smarter by cleaning up nullid
successors on the fly but it would be much for expensive. As core Mercurial does
not create any such changeset, I think it is fine to just abort when suspicious
situation is detected.

Earlier experimental version created such changesets, so there are some out
there.  The evolve extension added the necessary logic to clean up its mess.
obsolete: add example of marker usage in the documentation

Recent discussion with Augie Fackler pointed the lack of such example in the
documentation.
obsolete: flip `obstore.successors` and `obsolete.precursors`

People were confused by the fact `obstore.precursors` contained marker allowing
to find "precursors" and vice-versa.

This changeset changes their meaning to:

- precursors[x] -> set(markers on precursors edges of x)
- successors[x] -> set(markers on successors edges of x)

Some documentation is added to clarify the situation.
run-tests: alternative way of handling \r on Windows

After f71d60da58fb all \r was stripped from output on Windows, and the places
where a \r explicitly was expected it was accepted that it was missing. Ugly
hack.

Instead we now accept that an extra \r might appear at the end of lines on
Windows. That is more to the point and less ugly.
run-tests: make it possible to combine (esc) with (glob) and (re)

This makes it possible to combine the annotations ... if done in the right
order.
test-subrepo-recursion.t: re-introduce glob to handle \ slashes on Windows

Regression was introduced in 6047947afb6b.

Resolved by using the fine line noise '\r (no-eol) (glob) (esc)'.
perf: simply use repo.store for perffncache* commands

This makes sure that .hg/requires is observed and the correct kind of store
object is created. Otherwise we might mutilate our test repos when experimenting
with new repo formats.
test-log: fix / vs \ issues on Windows introduced with 6d218e47cf9b

test-log.t fails on Windows with

  --- c:\Users\buildbot\w2k8\Windows_2008_R2_hg_tests\build\tests\test-log.t
  +++ c:\Users\buildbot\w2k8\Windows_2008_R2_hg_tests\build\tests\test-log.t.err
  @@ -1225,12 +1225,12 @@
     $ echo 1 > d5.d/f1
     $ echo 1 > .d6/f1
     $ hg add .
  -  adding .d6/f1
  -  adding D2/f1
  -  adding D3.i/f1
  -  adding d1/f1
  -  adding d4.hg/f1
  -  adding d5.d/f1
  +  adding .d6\f1
  +  adding D2\f1
  +  adding D3.i\f1
  +  adding d1\f1
  +  adding d4.hg\f1
  +  adding d5.d\f1
     $ hg commit -m "a bunch of weird directories"
     $ hg log -l1 d1/f1 | grep changeset
     changeset:   0:65624cd9070a
store: move __contains__() implementation from class fncache into fncachestore

This restores the previous semantics of fncache.__contains__().

(a followup to b9a56b816ff2)
store: add new _exists helper function on fncachestore
store: fncache may contain non-existent entries (fixes b9a56b816ff2)
clfilter: use changelog to iterate over the repo in branchpoint

Otherwise filtered changesets may cause false positives in `branchpoint()`.
branchpoint: remove useless intermediate set creation

We don't need to compute the set of all branchpoints. We can just check the
number of children that element of subset have. The extra work did not seems to
had particular performance impact but the code is simpler this way.