[Beta] Conflict in components while merging two branches

So, I made some changes in the design of a Form in a topic branch. I added a column panel and a Label and Rich Text inside of it.

Before merging into master branch since I didn’t finish all the work in that topic, I changed back into master and made some changes, a few of it were adding links to the same Form (bad idea…).

Now, when I try to merge the branches it says there’s conflicts in the yaml file (correct) but the Conflict Tab shows only this:
image

There’s not really an option to merge things… Only to ignore this conflict. I don’t really understand it since is the first time I’m dealing with a conflict in Anvil. Maybe there would be other options if it were in Python files?

The only option is to ignore and re-do then?

What this message means is that, on one side of the merge, you created two components and added them to a container (eg a ColumnPanel), but on the other side of the merge you deleted that container. The delete has “won”, which deleted the two new components along with it.

As it is, there is currently no way to restore those components: You can either:

  1. Recreate them by hand as part of resolving the merge (this is probably simplest)

  2. Abandon the merge, go back and re-create the panel on the side where you deleted it, or move the new components to a new container on the side where you created it, which will prevent the conflict occurring in the first place (this is more fiddly, but avoids redoing work)

(We have some ideas about being able to restore components that got deleted in a merge, by dragging them back out of the “graveyard” in the conflicts, but I haven’t put together a UI prototype yet.)

The thing is… The ColumnPanel wasn’t deleted. In fact, it’s was correctly merged. While in merging state, git / anvil correctly merged the ColumnPanel, which contained both the conflicted Label and Rich Text, and the other components I added while in master branch.

That’s what I don’t understand.

In this case, it was easy to fix, since it was just two components and I knew which were. I just ignored them (the only option I had), then got back to the previous commit and copy-pasted them in the current version. But if it were more, it could be a lot more troublesome to do.

I think the idea you mentioned of allowing the user to drag those conflicted components back to the form designer to wherever the user wants them to be is a great idea that would easily solve the problem with not much trouble to the user.

The topic was more of a mix of possible bug report, an honest question about what was I supposed to do in this situation other than ignore and redo, a question about if it were in a .py file I would be able to make merges more git-like and maybe a future request for a better way to handle this situation (your suggestion seems perfect to me!).

1 Like