Support merging with disassociated source namespace#130
Draft
NebelNidas wants to merge 6 commits intoFabricMC:devfrom
Draft
Support merging with disassociated source namespace#130NebelNidas wants to merge 6 commits intoFabricMC:devfrom
NebelNidas wants to merge 6 commits intoFabricMC:devfrom
Conversation
Also introduces a fallback for cases where pending elements haven't received a tree-side source name, but an overlap with other tree-side namespaces exists.
Mainly for use in tests to ensure our test data doesn't violate any API contracts.
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.
Currently, if a tree has
and you want to merge
cls1NsCNamenever finds its way into the tree, as the visit pass doesn't supply ansAname. Even worse, if you visit withnsCon the source andnsBon the destination side, an exception is thrown, since the incoming source namespace (nsC) doesn't exist in the tree yet.Both of these cases can be solved by iterating all incoming namespaces that actually are present in the tree (
nsBin this case), searching for entries with the same name (here:cls1NsBName) and if found, merging the new data into that existing entry, leading to the following result:That's exactly what this PR does, however there's an edge case I wasn't sure how to handle: What if we find a match in more than one namespace, but each one belonging to a different entry?
Tree:
To be merged:
This would match both
cls1andcls2. As of now, this PR returns after merging with the first match, but we could of course merge with the remaining matches too or throw an exception instead. What are your opinions on this?