svn 1.7 error E200009 Could not add all targets because some targets are already versioned

余生长醉 提交于 2020-01-23 04:33:40

问题


I did a clean checkout of a repository then every day I have an hudson job that runs a script to backup the configuration. Part of the script is to add *.xml

$ svn add *.xml
svn: warning: W150002: '/data/hudson/config.xml' is already under version control
svn: E200009: Could not add all targets because some targets are already versioned
svn: E200009: Illegal target for the requested operation

The warning is fine because some of the xml files are already under version control but I don't understand why I get the E200009 error. If there is nothing to add, there should be no error.


回答1:


Seems like the correct behaviour for SVN 1.7. An alternative is to add only unversioned files:

svn st *.xml | grep ? | tr -s ' ' | cut -d ' ' -f 2 | xargs svn add

However it's possible you have nothing to add, so you will get

svn: E205001: Try 'svn help' for more info
svn: E205001: Not enough arguments provided

Related question: Add all unversioned files to Subversion using one Linux command




回答2:


svn add something --force will solve the error E200009. In your case, svn add *.xml --force will solve your problem




回答3:


Once, I met this error info, because I add a directory in a SVN directory. The directory which I added is copied from another SVN director, and it had a .svn directory, so I met the error info. Remove the .svn directory (rm -rf .svn) and it will work after.

This is the same case I met. Hope it help some other people.




回答4:


Like Sydney's answer, I have another one-line command:

svn st | grep ^? | awk '{print $2}' | xargs svn add



来源:https://stackoverflow.com/questions/15620547/svn-1-7-error-e200009-could-not-add-all-targets-because-some-targets-are-already

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!