diff options
author | Gökçen Nurlu <gnurlu1@bloomberg.net> | 2018-11-23 17:05:53 +0000 |
---|---|---|
committer | Gökçen Nurlu <gnurlu1@bloomberg.net> | 2018-11-23 17:05:57 +0000 |
commit | af2bf4a7bb019d764e895bcb99ad5644aa69756b (patch) | |
tree | db34d2786bf434ba310a8c3a9f3d8f475a09abd9 | |
parent | 0a2c52c620555fcfbdd9c7ed48cd22abe9dfa1f9 (diff) | |
download | buildstream-af2bf4a7bb019d764e895bcb99ad5644aa69756b.tar.gz |
Make source-checkout fetch by default
This replaces `--fetch` with `--no-fetch`.
-rw-r--r-- | buildstream/_frontend/cli.py | 8 | ||||
-rw-r--r-- | buildstream/_stream.py | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/buildstream/_frontend/cli.py b/buildstream/_frontend/cli.py index d9ce8c598..8596bd651 100644 --- a/buildstream/_frontend/cli.py +++ b/buildstream/_frontend/cli.py @@ -684,20 +684,20 @@ def checkout(app, element, location, force, deps, integrate, hardlinks, tar, no_ @click.option('--deps', '-d', default='none', type=click.Choice(['build', 'none', 'run', 'all']), help='The dependencies whose sources to checkout (default: none)') -@click.option('--fetch', 'fetch_', default=False, is_flag=True, - help='Fetch elements if they are not fetched') +@click.option('--no-fetch', 'no_fetch', default=False, is_flag=True, + help="Disable auto-fetching of element and related junction(s)") @click.argument('element', type=click.Path(readable=False)) @click.argument('location', type=click.Path()) @click.pass_obj -def source_checkout(app, element, location, deps, fetch_, except_): +def source_checkout(app, element, location, deps, no_fetch, except_): """Checkout sources of an element to the specified location """ with app.initialized(): app.stream.source_checkout(element, location=location, deps=deps, - fetch=fetch_, + fetch=not no_fetch, except_targets=except_) diff --git a/buildstream/_stream.py b/buildstream/_stream.py index 36086ed90..67c861c9a 100644 --- a/buildstream/_stream.py +++ b/buildstream/_stream.py @@ -439,13 +439,13 @@ class Stream(): # target (str): The target element whose sources to checkout # location (str): Location to checkout the sources to # deps (str): The dependencies to checkout - # fetch (bool): Whether to fetch missing sources + # fetch (bool): Whether to fetch missing sources, including junction(s) # except_targets (list): List of targets to except from staging # def source_checkout(self, target, *, location=None, deps='none', - fetch=False, + fetch=True, except_targets=()): self._check_location_writable(location) @@ -453,7 +453,7 @@ class Stream(): elements, _ = self._load((target,), (), selection=deps, except_targets=except_targets, - fetch_subprojects=True) + fetch_subprojects=fetch) # Assert all sources are cached if fetch: |