Is there a command to list SVN conflicts?
Does anyone kn开发者_如何学JAVAow an SVN command to list current conflicts between the repo and the working copy?
Thanks
On Linux, if you want to see only the conflicts, pipe the status through grep.
svn status | grep -P '^(?=.{0,6}C)'
Just use grep!
svn st | grep '^C'
You could try svn merge -r <revision> --dry-run
and see what happens that way.
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.
If you have ack from http://betterthangrep.com/, you can do the following
svn st | ack '^C'
For Windows PowerShell use:
svn status | sls -Pattern '^(?=.{0,6}C)'
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.
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
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 ...]
精彩评论