subrepo: fix exception on revert when "all" option is omitted

Since fafdff7e9c43, backout does not set opts['all'], which causes KeyError
at hgsubrepo.revert.
unionrepo: read-only operations on a union of two localrepos

unionrepo is just like bundlerepo without bundles.

The implementation is very similar to bundlerepo, but I don't see any obvious
way to generalize it.

Some most obvious use cases for this would be log and diff across local repos,
as a kind of preview of pulls, for instance:

  $ hg -R union:repo1+repo2 heads
  $ hg -R union:repo1+repo2 log -r REPO1REV -r REPO2REV
  $ hg -R union:repo1+repo2 log -r '::REPO1REV-::REPO2REV'
  $ hg -R union:repo1+repo2 log -r 'ancestor(REPO1REV,REPO2REV)'
  $ hg -R union:repo1+repo2 diff -r REPO1REV -r REPO2REV

This is going to be used in RhodeCode, and Bitbucket already uses something
similar. Having a core implementation would be beneficial.

--HG--
extra : rebase_source : cb8f9460419bc4a82644b78781bae25d70e1a062
vfs: split "expand" into "realpath"/"expandpath" to apply each separately

Before this patch, vfs constructor applies both "util.expandpath()"
and "os.path.realpath()" on "base" path, if "expand" is True.

This patch splits it into "realpath" and "expandpath", to apply each
functions separately: this splitting can allow to use vfs also where
one of each is not needed.

--HG--
extra : rebase_source : ba141374e25948bc2e68bbd1a31a39c65fe09c1b
localrepo: use vfs instead of "os.path.*" in sharedpath checking

In the point of view of efficiency, "vfs" instance created in this
patch should be passed to and reuse in "store.store()" invocation just
after patched code block, because "store" object is initialized by vfs
created with "self.sharedpath".

eBut to focus just on migration from direct file I/O API accessing to
vfs, this patch uses created vfs as temporary one. Refactoring around
"store.store()" invocation will be done in the future.

--HG--
extra : rebase_source : 8521288c9ab324e582793809b042f76dd7cc5c23
localrepo: use "vfs.exists()" instead of "os.path.exists()"

--HG--
extra : rebase_source : 9e6acd0e12743d912b6a8fe0ae8bf6bd2551c00f
localrepo: use "vfs.rename()" instead of "util.rename()"

--HG--
extra : rebase_source : 83c2a4f5fb8e803a61d9aa1da0dd530a01917d35
localrepo: use "vfs.islink()" instead of "os.path.islink()"

--HG--
extra : rebase_source : e9bf9a325130912f09eff0e56c710ea4c2b8ab2b
localrepo: use "vfs.readlink()" instead of "os.readlink()"

--HG--
extra : rebase_source : 6516a1a529ed6a44ad68733c50b71e05c873e281
localrepo: use "vfs.setflags()" instead of "util.setflags()"

--HG--
extra : rebase_source : 1e0e29d019a5e6a2058b3cf5a796bc1a20c666b9
localrepo: use "vfs.rename()" instead of "util.rename()"

This patch makes "_journalfiles()" return a list of pairs of journal
file and corresponded vfs instance instead of a list of journal files
in full path, to use "vfs.rename()" instead of "util.rename()" in
"aftertrans()".

"undofiles()" still returns a list of undo files in full path, because
"repair.strip()" expects such list. It'll be also made to return a
list of pairs of undo file and corresponded vfs at vfs migration for
"repair.strip()" in the near future.

--HG--
extra : rebase_source : 86ce487a16da4627693c60d50596882133b75c20