You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by no...@apache.org on 2020/12/29 12:38:06 UTC
[buildstream] 03/09: Add no-fetch flag for 'bst track' command
This is an automated email from the ASF dual-hosted git repository.
not-in-ldap pushed a commit to branch gokcen/add_no_fetch_flag
in repository https://gitbox.apache.org/repos/asf/buildstream.git
commit cd3e029ca3630fe74fdcd49d461cddee2a61cc34
Author: Gökçen Nurlu <gn...@bloomberg.net>
AuthorDate: Fri Oct 26 10:32:34 2018 +0100
Add no-fetch flag for 'bst track' command
---
buildstream/_frontend/cli.py | 7 +++++--
buildstream/_stream.py | 6 ++++--
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/buildstream/_frontend/cli.py b/buildstream/_frontend/cli.py
index 6301fa5..67464d7 100644
--- a/buildstream/_frontend/cli.py
+++ b/buildstream/_frontend/cli.py
@@ -397,8 +397,10 @@ def fetch(app, elements, deps, track_, except_, track_cross_junctions):
help="Allow crossing junction boundaries")
@click.argument('elements', nargs=-1,
type=click.Path(readable=False))
+@click.option('--no-fetch', 'no_fetch', default=False, is_flag=True,
+ help="Disable auto-fetching of junction(s)")
@click.pass_obj
-def track(app, elements, deps, except_, cross_junctions):
+def track(app, elements, deps, except_, cross_junctions, no_fetch):
"""Consults the specified tracking branches for new versions available
to build and updates the project with any newly available references.
@@ -419,7 +421,8 @@ def track(app, elements, deps, except_, cross_junctions):
app.stream.track(elements,
selection=deps,
except_targets=except_,
- cross_junctions=cross_junctions)
+ cross_junctions=cross_junctions,
+ no_fetch=no_fetch)
##################################################################
diff --git a/buildstream/_stream.py b/buildstream/_stream.py
index cd69808..72e4990 100644
--- a/buildstream/_stream.py
+++ b/buildstream/_stream.py
@@ -256,6 +256,7 @@ class Stream():
# selection (PipelineSelection): The selection mode for the specified targets
# except_targets (list of str): Specified targets to except from tracking
# cross_junctions (bool): Whether tracking should cross junction boundaries
+ # no_fetch (bool): Flag to disable auto-fetch of junctions needed by `targets`
#
# If no error is encountered while tracking, then the project files
# are rewritten inline.
@@ -263,7 +264,8 @@ class Stream():
def track(self, targets, *,
selection=PipelineSelection.REDIRECT,
except_targets=None,
- cross_junctions=False):
+ cross_junctions=False,
+ no_fetch):
# We pass no target to build. Only to track. Passing build targets
# would fully load project configuration which might not be
@@ -274,7 +276,7 @@ class Stream():
except_targets=except_targets,
track_except_targets=except_targets,
track_cross_junctions=cross_junctions,
- fetch_subprojects=True)
+ fetch_subprojects=not no_fetch)
track_queue = TrackQueue(self._scheduler)
self._add_queue(track_queue, track=True)