简体   繁体   中英

Subversion: How to resolve conflicts in merge --reintegrate?

I'm using Subversion in a very simple way: I'm the only one working on the code, and I have a "prod" and a "devel" branch. Whenever I try to merge --reintegrate anything but the most simple changes, I get conflicts and lots of options on what to do with them which I don't understand because I don't get the meaning of "mine" and "theirs" in this context (where there is only "me"). Also I haven't changed anything at all in the "prod" branch since the last successful reintegrate, and I also haven't forgotten to check in and update after the merge.

The last few times I've been in this situation I ended up deleting the .svn subdir and the repository and started a new repository based on the latest contents of my "devel" subtree.

Needless to say I have perused the relevant chapter in the svn book several times, but it only mentions conflict scenarios where there really somebody else has been working on the same part of the same file, which in my case obviously hasn't happened.

So my questions are:

  • Why does the conflict arise in the first place?

  • What do I need to do to resolve the conflict when it happens?

Why does the conflict arise in the first place?

Because something appeared in conflicted state, obviously

What do I need to do to resolve the conflict when it happens? Check it nature, resolve by hand.

BTW, you can always test your merges before real merges with --dry-run option, inspect results and prepare all needed to real merge

… or migrate to Mercurial, where you'll get a lot less merge-hell in obvious cases (and some not-obvious-for-SVN - too, like merges of edit+rename in merged branches)

It seems like I have to first merge ^/prod into ^/devel, and then do the reintegrate of ^/devel into ^/prod (with check-in and update in between). I was pretty sure I had nothing changed in /prod since the last reintegrate, but was probably wrong and then got confused by those "us vs them" error messages.

The svn book mentions that one should merge first but I didn't pay much attention because I thought that only applied in cases where "they" did something to the trunk independent of "me".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM