Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MER-2352] Make branch adoption work #121

Merged
merged 1 commit into from
May 26, 2023
Merged

Conversation

draftcode
Copy link
Contributor

@draftcode draftcode commented May 18, 2023

Close #120.

@aviator-app
Copy link
Contributor

aviator-app bot commented May 18, 2023

Current Aviator status

Aviator will automatically update this comment as the status of the PR changes.
Comment /aviator refresh to force Aviator to re-examine your PR (or learn about other /aviator commands).

This PR was merged using Aviator.


See the real-time status of this PR on the Aviator webapp.

@@ -34,6 +34,24 @@ func Reparent(
tx meta.WriteTx,
opts ReparentOpts,
) (*ReparentResult, error) {
branchMeta, exist := tx.Branch(opts.Branch)
if !exist {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so this was not working previously if the current branch was not part of any existing stack?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. That's why I added a test.

Copy link
Contributor

@twavv twavv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused by this -- can you hold off on merging for a second? I wanna look at it a bit more if that's okay!

@draftcode draftcode force-pushed the fix_branch_adoption branch 2 times, most recently from 8abc3af to 5cb01ac Compare May 25, 2023 18:03
}
branchMeta.Parent.Head = head
}
tx.SetBranch(branchMeta)
Copy link
Contributor

@twavv twavv May 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to do this SetBranch here.

I think it's effectively a no-op right now because we do the SetBranch in reparentWriteMetadata which is called on every code path (unless there's a conflict... is that an issue? 🙃).

At any rate, I think this is fine (as in it ~~works~~) but it's a little hard to follow.

@draftcode draftcode changed the title fix: Make branch adoption work [MER-2352] Make branch adoption work May 26, 2023
@aviator-app aviator-app bot merged commit 7274802 into master May 26, 2023
@aviator-app aviator-app bot deleted the fix_branch_adoption branch May 26, 2023 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reparenting won't work
3 participants