How can I get SVN to accept a specific resolution for all binary conflicts without asking me for each?

When starting svn up I regularly come across this hint:

 Conflict discovered in 'lib/somelibrary.so'. Select: (p) postpone, (mf) mine-full, (tf) theirs-full, (s) show all options: 

Pressing s shows the parameters mc and tc , my-conflict and theirs-conflict, which supposedly allow me to take either my version or their version for all conflicts, not just somelibrary.so .

However, these options do not work. I get this message:

 Invalid option; cannot choose based on conflicts in a binary file. 

Edwin's answer makes it clear that I misunderstood how mc and tc , but I still want to have the same resolution for each conflicting file. Is there a way to make svn use mf or tf for each conflict without asking me again after the first time?

+7
source share
2 answers

To automatically resolve conflicts on svn update , svn switch , svn merge , use the --accept flag.

From SVN Book - svn options :

- take action
Specifies an action to automatically resolve conflicts. Possible actions are delayed, filled, filled, completely filled, edited and launched.

The meaning of each action can be seen in the svn resolve specification :

You can pass the following arguments to the --accept command, depending on the resolution you want:

base Select a file that was a version of BASE before upgrading your working copy. That is, the file that you checked before you made your last changes.

Work Assuming that you manually handled conflict resolution, select the version of the file as it currently appears in your working copy.

my-full Allow all conflicting files with copies of the files as they stood immediately before you started the svn update.

theirs-full Allow all conflicting files with copies of files that were extracted from the server when the svn update was launched.

my-conflict Allow all conflicting files, preferring local changes to changes that have occurred from the server in the conflicting regions of each file content.

theirs-conflict Allow all conflicting files, preferring the changes to be extracted from the server by local changes in the conflicting regions of each file content.

Also check out the Resolve Any Conflict section.

Finally, an example. To automatically resolve all conflicts as mine-full when upgrading, do:

 $ svn up --resolve mine-full 
+10
source

mc and tc combine parameters where only conflicting lines are considered, and then these lines merge from your sources (mc) or "other" sources (tc).

Binary files, as a rule, are not structured in such a way that they contain lines, as such, conflict resolution algorithms based on replacing one line of text with another line of text will not work properly for a binary file. Developers who wrote SVN are aware of this, so when working with a binary file, options that make sense only with text files are not accepted.

You can use mf and tf, which are slightly different. Instead of replacing only conflicting areas of the file, they replace the entire file (mf) with "my" copy of the full file or (tf) "their" copy of the full file).

If you want SVN to run and accept the mc / tc file parameters, svn edit the mime type and set it to text. Good luck, if it is not a text file, the likelihood that you will receive a file that does not meet the specifications or the starting binary file (for example, combining continuous partitions from two jpeg files will not lead to a valid jpeg file).

+1
source

All Articles