Is there a command to list SVN conflicts?
SvnSvn 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 ...]