Subversion: failing to update when conflicts occur?

Is there a way to tell subversion "update / merge if this does not lead to a conflict"?

I know that you can use --dry-run / status -u to check before starting the update, but often I have others who run updates and get broken web pages because they don’t notice the line "C index.php "

I also noticed that svn does not seem too dissatisfied with conflicts - it still says “upgrades to the blah version” and exits from zero regardless of conflicts. Therefore, I have to parse the line output in order to detect them. Surely there is a better way?

+4
source share
6 answers

You can use the --accept option to specify what should happen when a conflict occurs:

 --accept ARG : specify automatic conflict resolution action ('postpone', 'base', 'mine-full', 'theirs-full', 'edit', 'launch') 

See also interactive conflict resolution in svnbook

+3
source

Perhaps the best way is to use a graphics tool? Or write a script to do an update that redirects the output to a file and does "cat svnupdate.log | grep" ^ C "at the end to show you any conflicts?

Using the graphical tools that I use (TortoiseSVN and Netbeans), they create an unpleasant noise at the end and present you with a merge selection dialog for working with them. I do not know the equivalent with the same power for command line tools.

+1
source

@jsight: TortoiseSVN is great, but I'm primarily developing in * NIX without X. Therefore, I usually use the (limited) command line.

In my script proposal, what I'm working on now is why it annoys me that I can't just check $ ?. Right now I am skipping "output to file" and using the channel, but otherwise exactly what you are describing.

+1
source

You can use the --diff3-cmd option to specify which merge tool to use (usually diff3 from diffutils).

+1
source

you can also use a pre-commit script to search for conflict markers in files and prevent commit when they are present.

0
source

Subversion 1.5 (recently released) adds some ability to indicate what happens during an update conflict, with the argument "-accept".

0
source

Source: https://habr.com/ru/post/1276474/


All Articles