test: add testing of checkheads behavior with obsolete

Expected behavior is quite complex. Explicit testing with clear
scenarios is welcome.
checkheads: attend to phases when computing new heads with obsolete

Checkheads was more permissive than expected. When the remote heads
are public we don't need to search for successors. None will make a
public head disappear.
checkheads: check successors for new heads in both missing and common

A relevant obsolete marker may have been added -after- we previously
exchanged the changeset. We have to search for remote heads that
disappear by the sole fact of pushing obsolescence.

This case will also happen when remote got the new version from a
repository that does not propagate obsolescence markers.
checkheads: don't warn about unsynced changes that we ill obsolete

We won't be able to pull them after this push.
bookmarks: extract valid destination logic in a dedicated function

We usually update bookmarks only if the new location is descendant of the old
bookmarks location.  We extract this logic into a function. This is the first
step to allow more complex logic using obsolescence in this validation of the
bookmark movement.
bookmark: take successors into account when updating (issue3561)

When we rewrite a bookmarked changeset, we want to update the
bookmark on its successors. But the successors are not descendants
of its precursor (by definition). This changeset alters the bookmarks
logic to update bookmark location if the newer location is a successor
of the old one[1].

note: valid destinations are in fact any kind of successors of any kind
      of descendants (recursively.)

This changeset requires the enabling of the obsolete feature in
some bookmark tests.
largefiles: preserve exit code from outgoing command (issue3611)

This maintains the exit codes documented in commands.py.

--HG--
branch : stable
largefiles: exit from remove with 1 on warnings

This maintains the exit codes documented in commands.py.

--HG--
branch : stable
largefiles: preserve the exit status of the log command

--HG--
branch : stable
largefiles: preserve the exit status of the rebase command

--HG--
branch : stable
largefiles: preserve the exit status of the forget command

This maintains the exit codes documented in commands.py.

--HG--
branch : stable
Merge with mpm
perf: add perffncacheencode

Examples (all done with somewhat dated clones I found on my disk):

Netbeans (~120k entries in fncache):

  $ hg perffncacheencode
  ! wall 4.338000 comb 4.336828 user 4.336828 sys 0.000000 (best of 3)

Openoffice (~77k entries in fncache)):

  $ hg perffncacheencode
  ! wall 1.533000 comb 1.528810 user 1.528810 sys 0.000000 (best of 7)

Xen (~10k entries in fncache):

  $ hg perffncacheencode
  ! wall 0.198000 comb 0.187201 user 0.187201 sys 0.000000 (best of 51)

Done on Windows 7 x64.
scmutil: turn opener._audit into a property, mustaudit

This will be used by an upcoming patch.
scmutil: delegate mustaudit property to the real opener

This will be used by an upcoming patch.
wireproto: don't audit local paths during stream_out

Auditing at this stage is both pointless (paths are already trusted by
the local repo) and expensive. Skipping the audits improves stream_out
performance by about 15%.
wireproto: bypass filechunkiter for small files when streaming

Merely creating and using a generator has a measurable impact,
particularly since the common case for stream_out is generators that
yield just once. Avoiding generators improves stream_out performance
by about 7%.
wireproto: don't format a debug string inside a hot loop

This improves stream_out performance by about 5%.
scmutil: make join cheaper

Combined with a few followup patches, this contributes to improving
stream_out performance by 10%.
util: implement a faster os.path.split for posix systems

This is not yet used.