summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGökçen Nurlu <gnurlu1@bloomberg.net>2018-10-26 10:32:34 +0100
committerGökçen Nurlu <gnurlu1@bloomberg.net>2018-11-23 16:19:50 +0000
commitcd3e029ca3630fe74fdcd49d461cddee2a61cc34 (patch)
tree0e0ed1cfb2a9d6eb5b3471172539ec979c8c865d
parent8fe2930f05316d96784bafc9870f17f969dbf271 (diff)
downloadbuildstream-cd3e029ca3630fe74fdcd49d461cddee2a61cc34.tar.gz
Add no-fetch flag for 'bst track' command
-rw-r--r--buildstream/_frontend/cli.py7
-rw-r--r--buildstream/_stream.py6
2 files changed, 9 insertions, 4 deletions
diff --git a/buildstream/_frontend/cli.py b/buildstream/_frontend/cli.py
index 6301fa538..67464d7a3 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 cd69808ce..72e4990eb 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)