Is there a command to list SVN conflicts?

Svn

Svn Problem Overview


Does anyone know an SVN command to list current conflicts between the repo and the working copy?

Thanks

Svn Solutions


Solution 1 - Svn

On Linux, if you want to see only the conflicts, pipe the status through grep.

svn status | grep -P '^(?=.{0,6}C)'

Solution 2 - Svn

Just use grep!

svn st | grep '^C'

Solution 3 - Svn

You could try svn merge -r <revision> --dry-run and see what happens that way.

Solution 4 - Svn

If you have already merged you can use

svn status

and see an uppercase "C" for conflict, but usually you shouldn't see such kind in your working copy.

Solution 5 - Svn

If you have ack from http://betterthangrep.com/, you can do the following

svn st | ack '^C'

Solution 6 - Svn

For Windows PowerShell use:

svn status | sls -Pattern '^(?=.{0,6}C)'

Solution 7 - Svn

It's maybe possible to use svn merge --dryrun while specifying the repository URL with all revisions after the latest one you updated with.

E.g. if your current WC is based on revision 147 this could do it:

svn merge -r 148:HEAD http://url.to.repo/repo/

It's nothing I've done myself though, so you'll have to try it yourself.

Solution 8 - Svn

If you haven't merged or updated files then use below command

svn status --show-updates | grep -P '.*(?=.*M)(?=.*\*).*'

For short

svn st -u | grep -P '.*(?=.*M)(?=.*\*).*'

Details
SVN don't mark conflict(C) status until you update the file(s) using svn update.
Until then statuses are shown like below

+---+------+---------------+---------------+
| M |      |               | 23246   file1 |
+---+------+---------------+---------------+
|   |      | *             | 23233   file2 |
+---+------+---------------+---------------+
| M |    * | 23233   file3 |               |
+---+------+---------------+---------------+

M - Modified in local
* - Updates/Incoming from remote
M and * - Modified in local, as well as in remote - This is a conflict but svn haven't marked yet

Solution 9 - Svn

on mac

$ svn status | grep -e '^!'

did the job

here is the man for grep:

> usage: grep [-abcDEFGHhIiJLlmnOoqRSsUVvwxZ] [-A num] [-B num] [-C[num]] [-e pattern] [-f file] [--binary-files=value] [--color=when] [--context[=num]] [--directories=action] [--label] [--line-buffered] [--null] [pattern] [file ...]

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionazz0rView Question on Stackoverflow
Solution 1 - Svnnshew13View Answer on Stackoverflow
Solution 2 - SvnJoseph LustView Answer on Stackoverflow
Solution 3 - SvncorsiKaView Answer on Stackoverflow
Solution 4 - SvnkhmarbaiseView Answer on Stackoverflow
Solution 5 - SvnbananaausView Answer on Stackoverflow
Solution 6 - SvnAyo IView Answer on Stackoverflow
Solution 7 - SvnAnders AbelView Answer on Stackoverflow
Solution 8 - SvnSameerView Answer on Stackoverflow
Solution 9 - SvnthesummersignView Answer on Stackoverflow