do not call update_alternates if package.importdir != package.srcdir

importdir != srcdir really says that the current package is not the
one being imported, and that the alternates list cannot be generated,
so skip the update.

This fixes a bunch of warnings when using importdir with cache, where
the alternates would basically be modified for each sub-package.
Merge pull request #9 from rock-core/fix_importdir_and_git_caching

do not call update_alternates if package.importdir != package.srcdir
git: fix interaction between detached HEADs and only_local

When using local-only access and detached HEADs, the remote commit
was not properly resolved in #update, which would lead to an invalid
call to merge-base.
importers: streamline subprocess calling

This commit modifies all calls to Subprocess.run to get rid of Dir.chdir
as much as possible (with the longer term target to parallelize import),
as well as using Package#run instead of Subprocess.run directly. It finally
removes most calls to the backtick operator to call the autobuild run facilities
instead, ensuring proper quoting and error reporting
importers: make the retry behaviour a per-exception attribute

We basically only want to retry if the importer has hit the network.
In all other cases, the error is really final.
rework the windows handling code in Subprocess.run

The new code is a lot simpler, and also fixes a missing cleanup on
exception bug: if an exception was raised between the two chdirs, the
process would stay in the package's directory
svn: fix checkout
document Subcommand.run
git: reset --hard must be run with a working copy