convert: remove unused and incorrect default handling for revmapfile

destc is not a string and can thus not be os.path.join'ed. Convert would crash
if we ended up there ... but we wouldn't because both the sinks (hg and
subversion) sinks implement .revmapfile and "never" throws exceptions.
convert: refactor head calculation for hg sources
convert: introduce hg.revs to replace hg.startrev and --rev with a revset

The existing knobs for controlling which revisions to convert were often
insufficient. Revsets is a shiny hammer that provides a better solution.

Revsets has been introduced in --rev handling in a lot of other places while
being more or less backwards compatible. Doing the same here would be a much
more elegant ... but that would unfortunately not work in this case.  "--rev 7"
used to mean revision 0 to 7 - it would be an unacceptable change if it
suddenly just meant revision 7.

Instead we introduce a new configuration setting. It will only work for
Mercurial repositories so adding a new commandline option for it would not be a
nice solution.

There is no way to use the fancy deprecation markup for configuration settings
so we just remove the documentation of hg.startrev.
convert: update source shamap when using filemap, just as when not using filemap

The reverse mapping was introduced in 2147a734dcf9 to make roundtrip
conversions possible ... but it did not work when using filemap.

Roundtrips with filemaps will of course only work flawlessly if inverse
mappings are used.

Especially, if a lossy convert mapping is used in one direction, then only
linear lines of development can be converted in the other direction. With this
constraint convert will do the right thing by assuming that excluded files
haven't been changed.)

A test case with general coverage of hg-hg roundtrips with filemap is added.

(There a cases where adding records of converted revisions to the shamap in the
source repository doesn't work - especially when converting the same repo to
several other repos and back. It would arguably be better if convert only
updated the shamaps in the target repo but read shamaps from both the source
and and target repo ... but that is a different story. Making the stuff we have
work consistently is step forward no matter what.)
graft: make skip messages more helpful

This makes it possible for the user to understand and accept or work around
what is happening.
cmdutil: use None as default value for "function pointer" instead of False

Less type confusion.
bookmarks: use "vfs.unlink()" instead of "util.unlink()"
bookmarks: use "vfs.utime()" instead of "os.utime()"
vfs: add "open()" for newly added code paths which open files via vfs

This patch replaces "open()" by own "__call__()" defined in derived
classes at the first invocation, for efficiency of succeeding
invocations.
changelog: use "vfs.rename()" instead of "util.rename()"
changelog: use "vfs.fstat()" instead of "util.fstat()"

Just invoking "os.fstat()" with "file.fileno()" doesn't require non
ANSI file API, because filename is not used for invocation of
"os.fstat()".

But "util.fstat()" should invoke "os.stat()" with "fp.name", if file
object doesn't have "fileno()" method for portability, and "fp.name"
may cause invocation of non ANSI file API.

So, this patch makes the constructor of appender class invoke
"util.fstat()" via vfs, to encapsulate filename handling.
context: use "vfs.lstat()" instead of "os.lstat()"

This patch also changes paths added to "rejected" list from full path
(referred by "p") to relative one (referred by "f"), when type of
target path is neither file nor symlink.

This change should be reasonable, because the path added to "rejected"
list is relative one, when "OSError" is raised at "lstat()".
context: use "vfs.lstat()" instead of "os.lstat()"
context: use "vfs.lstat()" to examine target path instead of "os.path.*"

This patch gets stat object of target path by "vfs.lstat()", and
examines stat object to know the type of it. This follows the way in
"workingctx.add()".

This should be cheaper than original implementation invoking
"lexists()", "isfile()" and "islink()".
store: use "vfs.exists()" instead of "os.path.exists()"
shelve: drop pickle usage

Pickle was used to the `shelvedstate` file. However the content of the file is
very simple and we can handle serialisation ourself. Not using pickle is a net
win.

Note incrementing the format version as no releases have been done so far.