Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Subversion - Always resolve conflicts using mine for a set of files

Tags:

svn

conflict

We've got a sizable chunk of auto-generated code that we keep around in subversion. Sometimes I'm working on a piece of the generator while another coworker is working on a different piece of the generator. One of us checks in, and the other gets the latest. Now our generated code is in conflict. Because it's generated it'll be correct after the next time the generator is run, but subversion has flagged it as conflicted. It's a bit of a pain to go around, find these conflicts, verify that they are indeed due to generated code, and then manually "accept mine" to clear the conflicts.

Is there a way to have subversion recognize that for all the files in a given folder I just want to automatically accept mine? I'd like to stay away from dedicated batch files, as most of the office uses Tortoise SVN and I'm looking for a solution that everyone can use.

like image 852
Hounshell Avatar asked Jan 04 '10 20:01

Hounshell


People also ask

What does SVN conflict do?

Subversion prints a C during the update, and remembers that the file is in a state of conflict. If Subversion considers the file to be mergeable, it places conflict markers — special strings of text which delimit the sides of the conflict—into the file to visibly demonstrate the overlapping areas.

How can I see SVN conflicts?

Step 1: View ConflictsSelect: (p) postpone, (df) diff-full, (e) edit, (mc) mine-conflict, (tc) theirs-conflict, (s) show all options: Subversion is complaining that there is a conflict with the README file, and Subversion does not know how to solve this.


3 Answers

You should probably avoid having generated files in SVN in the first place - as you can tell, this is a source of conflicts. Better to have them be ignored, and build them as part of the build.

But as to your question, you should be able to use the --accept mine-full option to svn update, which makes conflicts automatically resolve to mine. See the Subversion manual and man pages for more details.

like image 92
Avi Avatar answered Oct 07 '22 04:10

Avi


svn update --accept [postpone|base|mine-full|theirs-full|edit|launch]

like image 43
Jason Avatar answered Oct 07 '22 03:10

Jason


That should be

svn resolve --accept [postpone|base|mine-full|theirs-full|edit|launch]

No?

like image 27
euroblaze Avatar answered Oct 07 '22 02:10

euroblaze