Ignore the files from merging
Asked Answered
M

2

1

I was trying to merge from my branch to trunk.Merge type was Range of revision. Kept the text blank so that I need to get all the revisions merged. Once done all the pom.xmls got conflicted. It is difficult to edit all the poms resolve the conflicts.

I would like to know is there any option to ignore the files which I do not need to merge with.

Version of tortoise svn is 1.6
Mafalda answered 21/11, 2014 at 10:1 Comment(0)
P
2

When you do a merge, you can accept which conflict you prefer to take. In Subversion, you can select theirs meaning the branch you're merging from or yours meaning the branch you're working on. In the command line, you can also specify if you want to only accept theirs or yours for just where the conflicts are, or the whole file. TortoiseSVN also offers the same options.

Of course, if pom.xml is truly messed up (maybe one of the developers decided to restructure the whole thing, so there's little match between the trunk and your branch), you can always do a revert after the merge. It's like skipping pom.xml during the merge.

I've had problems of developers helpfully restructuring a file and then having problems with merging because merges are mostly textual analysis, and can't handle file restructuring. The best thing to do is to revert pom.xml, and then find some sort of XML diff tool that can help you figure out the differences, and merge the ones you do want to keep.

Then make the changes that are needed in the pom.xml, and commit the merge after doing a manual merge of the pom.xml file.

Pelagias answered 21/11, 2014 at 16:17 Comment(0)
S
1

AFAIK, you can't ignore files being merge, but after the merge completed (and conflicted were created), you're able to resolve conflicts in specific files using "your side" version or "their side" version of the file. To cite svn help resolve manual:

--accept ARG             : specify automatic conflict resolution source
                         ('base', 'working', 'mine-conflict',
                          'theirs-conflict', 'mine-full', 'theirs-full')

No idea how that maps onto TortoiseSVN though…


Update: disregard my answer: this explains that the svn merge command has the --accept command-line option as well, and it's possible to choose whether to use "ours" or "theirs" version of files when merging.

Syllogize answered 21/11, 2014 at 11:1 Comment(2)
Ok. Then I have to goto each of the conflicted files and do a "your side" version or "their side" check right?Mafalda
@tailorBird, yes, but as it turned out, there's a better method -- see my updated answer. You have formulated your question somewhat "backwards" to how Subversion has it implemented, and that probably explains why it was hard to you to find the solution on SO.Syllogize

© 2022 - 2024 — McMap. All rights reserved.