Skip to content
Snippets Groups Projects
Commit b60130b0 authored by Jonathan Maw's avatar Jonathan Maw
Browse files

_stream.py: Opened workspaces store the project that opened them

parent 9852bc6f
No related branches found
No related tags found
No related merge requests found
......@@ -550,6 +550,8 @@ class Stream():
# So far this function has tried to catch as many issues as possible with out making any changes
# Now it dose the bits that can not be made atomic.
targetGenerator = zip(elements, expanded_directories)
workspace_project_cache = self._context.get_workspace_project_cache()
project = self._context.get_toplevel_project()
for target, directory in targetGenerator:
self._message(MessageType.INFO, "Creating workspace for element {}"
.format(target.name))
......@@ -574,6 +576,10 @@ class Stream():
with target.timed_activity("Staging sources to {}".format(directory)):
target._open_workspace()
workspace_project = workspace_project_cache.add(directory, project.directory,
target._get_full_name())
workspace_project.write()
# Saving the workspace once it is set up means that if the next workspace fails to be created before
# the configuration gets saved. The successfully created workspace still gets saved.
workspaces.save_config()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment