fix: use full element names in workspace reset#2125
Open
kotborealis wants to merge 1 commit into
Open
Conversation
Contributor
|
Thanks for the patch, I'll try to make some time to review it. Can you please add a tests for this? |
Fixes a bug where `workspace reset` did not work for junctions. For example, we have a project with struct like this: ``` nested.bst:hello.bst ``` So the root project has one element `nested.bst`, which is a junction to another project, and the junction has one element `hello.bst`. If we try to open this element as workspace, it works: ``` bst workspace open nested.bst:hello.bst ``` If we try to close this workspace, it works: ``` bst workspace close nested.bst:hello.bst ``` However, if we try `bst workspace reset` command on it, it fails with error `Workspace does not exist`. The error is that `workspace_reset` method called `workspace_exists` with `element.name`, which was resolved to just `hello.bst`. In comparsion, a few lines down, it uses `get_workspace` with `element._get_full_name()`, which is `nested.bst:hello.bst`. This patch updates `workspace_reset` function to check existence using element full name to support junctions.
ed224ed to
641451e
Compare
Contributor
Author
|
@abderrahim added one test for this exact case |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a bug where
workspace resetdid not work for junctions.For example, we have a project with struct like this:
So the root project has one element
nested.bst, which is a junction to another project, and the junction has one elementhello.bst.If we try to open this element as workspace, it works:
If we try to close this workspace, it works:
However, if we try
bst workspace resetcommand on it, it fails with errorWorkspace does not exist.The error is that
workspace_resetmethod calledworkspace_existswithelement.name, which was resolved to justhello.bst. In comparsion, a few lines down, it usesget_workspacewithelement._get_full_name(), which isnested.bst:hello.bst.This patch updates
workspace_resetfunction to check existence using element full name to support junctions.