<p>Is there a way to tell subversion "update/merge unless it would cause a conflict"?</p>

<p>I know you can use <code>--dry-run</code> / <code>status -u</code> to check before running the update, but I often have others running updates and getting broken webpages because they don't notice the "C   index.php" line.</p>

<p>I've also noticed that svn doesn't seem too unhappy about conflicts - it still says "updated to revision blah" and exits zero, regardless of conflicts.  So I have to parse the line-by-line output to discover them.  Surely there's a better way?</p>

[{'answer_id': 33483, 'author': 'jsight', 'author_id': 1432, 'author_profile': 'https://Stackoverflow.com/users/1432', 'pm_score': 1, 'selected': False, 'text': '<p>Perhaps a better way is to use a graphical tool?  Or write a script to do the update that redirects the output to a file and does a "cat svnupdate.log | grep "^C "" at the end to show you any conflicts?</p>\n\n<p>With the graphical tools that I use (TortoiseSVN and Netbeans), they make a nasty noise at the end and present you with a merge selection dialog for dealing with them.  I don\'t know of an equivalent with as much power for the command line tools.</p>\n'}, {'answer_id': 33504, 'author': 'Peter Stone', 'author_id': 1806, 'author_profile': 'https://Stackoverflow.com/users/1806', 'pm_score': 1, 'selected': False, 'text': '<p>@jsight: TortoiseSVN is great, but I primarily develop in a *NIX environment, without X.  So I\'m usually using (restricted to) the command line.</p>\n\n<p>In re your script suggestion, that\'s what I\'m working on now - which is why I\'m annoyed that I can\'t just check $?.  Right now I\'m skipping the "output to a file" and using a pipe, but otherwise exactly what you describe.</p>\n'}, {'answer_id': 33646, 'author': 'Damien B', 'author_id': 3069, 'author_profile': 'https://Stackoverflow.com/users/3069', 'pm_score': 1, 'selected': False, 'text': '<p>You could use the --diff3-cmd parameter to specify which merging tool to use (usually diff3 from diffutils).</p>\n'}, {'answer_id': 152539, 'author': 'Jean', 'author_id': 7898, 'author_profile': 'https://Stackoverflow.com/users/7898', 'pm_score': 0, 'selected': False, 'text': '<p>you could also use a pre-commit script to look for conflict markers in files and prevent commit when they are present.</p>\n'}, {'answer_id': 164940, 'author': 'Sander Rijken', 'author_id': 5555, 'author_profile': 'https://Stackoverflow.com/users/5555', 'pm_score': 3, 'selected': True, 'text': '<p>You can use the --accept parameter to indicate what should happen when a conflict occurs:</p>\n\n<pre><code>--accept ARG             : specify automatic conflict resolution action\n                          (\'postpone\', \'base\', \'mine-full\', \'theirs-full\',\n                          \'edit\', \'launch\')\n</code></pre>\n\n<p>See also the <a href="http://svnbook.red-bean.com/en/1.5/svn.tour.cycle.html#svn.tour.cycle.resolve.diff" rel="nofollow noreferrer">interactive conflict resolution</a> page in the svnbook</p>\n'}, {'answer_id': 165026, 'author': 'jackr', 'author_id': 9205, 'author_profile': 'https://Stackoverflow.com/users/9205', 'pm_score': 0, 'selected': False, 'text': '<p>Subversion 1.5 (recently released) adds some ability to specify what happens during an update conflict, with the "--accept" argument.</p>\n'}]
['https://Stackoverflow.com/questions/33471', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1806/']