summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Maw <jonathan.maw@codethink.co.uk>2018-06-29 18:28:48 +0100
committerJonathan Maw <jonathan.maw@codethink.co.uk>2018-07-16 17:12:08 +0100
commit4c6512d6f6e4defbddebab56a19e5e7f9e50c20c (patch)
tree857c4da0a5e8cc77355eaa54fdcc73aacf5146fb
parentddeac63acc607706a5b8ebf1f1a57b38427aa301 (diff)
downloadbuildstream-4c6512d6f6e4defbddebab56a19e5e7f9e50c20c.tar.gz
Only redirect elements for workspace and track operationsPRE_CAS_MERGE_JULY_2018
It was redirecting for checkout operations
-rw-r--r--buildstream/_frontend/cli.py4
-rw-r--r--buildstream/_pipeline.py5
-rw-r--r--buildstream/_stream.py14
3 files changed, 19 insertions, 4 deletions
diff --git a/buildstream/_frontend/cli.py b/buildstream/_frontend/cli.py
index e59b1baec..c75e7ac6a 100644
--- a/buildstream/_frontend/cli.py
+++ b/buildstream/_frontend/cli.py
@@ -408,6 +408,10 @@ def track(app, elements, deps, except_, cross_junctions):
all: All dependencies of all specified elements
"""
with app.initialized(session_name="Track"):
+ # Substitute 'none' for 'redirect' so that element redirections
+ # will be done
+ if deps == 'none':
+ deps = 'redirect'
app.stream.track(elements,
selection=deps,
except_targets=except_,
diff --git a/buildstream/_pipeline.py b/buildstream/_pipeline.py
index 9f4504d3f..852abf7ff 100644
--- a/buildstream/_pipeline.py
+++ b/buildstream/_pipeline.py
@@ -44,6 +44,9 @@ class PipelineSelection():
# Select only the target elements in the associated targets
NONE = 'none'
+ # As NONE, but redirect elements that are capable of it
+ REDIRECT = 'redirect'
+
# Select elements which must be built for the associated targets to be built
PLAN = 'plan'
@@ -215,6 +218,8 @@ class Pipeline():
elements = None
if mode == PipelineSelection.NONE:
+ elements = targets
+ elif mode == PipelineSelection.REDIRECT:
# Redirect and log if permitted
elements = []
for t in targets:
diff --git a/buildstream/_stream.py b/buildstream/_stream.py
index 5013daf3b..4b699c1f2 100644
--- a/buildstream/_stream.py
+++ b/buildstream/_stream.py
@@ -263,7 +263,7 @@ class Stream():
# are rewritten inline.
#
def track(self, targets, *,
- selection=PipelineSelection.NONE,
+ selection=PipelineSelection.REDIRECT,
except_targets=None,
cross_junctions=False):
@@ -421,7 +421,9 @@ class Stream():
else:
track_targets = ()
- elements, track_elements = self._load((target,), track_targets)
+ elements, track_elements = self._load((target,), track_targets,
+ selection=PipelineSelection.REDIRECT,
+ track_selection=PipelineSelection.REDIRECT)
target = elements[0]
workdir = os.path.abspath(directory)
@@ -514,7 +516,9 @@ class Stream():
else:
track_targets = ()
- elements, track_elements = self._load(targets, track_targets)
+ elements, track_elements = self._load(targets, track_targets,
+ selection=PipelineSelection.REDIRECT,
+ track_selection=PipelineSelection.REDIRECT)
nonexisting = []
for element in elements:
@@ -699,7 +703,9 @@ class Stream():
else:
output_elements.add(e)
if load_elements:
- loaded_elements, _ = self._load(load_elements, ())
+ loaded_elements, _ = self._load(load_elements, (),
+ selection=PipelineSelection.REDIRECT,
+ track_selection=PipelineSelection.REDIRECT)
for e in loaded_elements:
output_elements.add(e.name)