_stream.py: Pre-emptive pulling of artifact metadata in some cases

In any case that the user has requested artifacts be pulled, and that
artifact targets have been specified, pre-emptively pull the target
artifact metadata so that the operation can complete coherently.

Specifically, this fixes:

  * bst artifact pull --deps build <artifact name>
  * bst artifact checkout --deps build --pull <artifact name>

In these cases, we cannot know the build dependencies of the artifact
if we do not at least try to obtain the toplevel target artfiact(s) first,
so we instate a policy to initially download metadata.

This introduces a new parameter to the general purpose _load() function,
which is called `attempt_artifact_metadata`.

When `attempt_artifact_metadata` is specified, we will attempt to download
artifact metadata for toplevel specified targets, this way we can derive
their dependencies which is needed for some operations.

Currently this unfortunately downloads the entire artifact, but should
be optimized later on to download only the required metadata.
1 file changed