开发者

subversion and Eclipse usage

开发者 https://www.devze.com 2023-02-19 19:14 出处:网络
This is a question on the essential subversion plus Eclipse work process. When I check in my Eclipse (Java) project for the first time,

This is a question on the essential subversion plus Eclipse work process.

When I check in my Eclipse (Java) project for the first time,

svnadmin create /home/jack/svnrepoz
svn import myfolder   file:///home/jack/svnrepoz/myfolder

and then proceed to checkout, there will be a complaint.

svn   checkout  file:///home/jack/svnre开发者_如何学编程poz/myfolder    myfolder
Failed to add file: 'myfolder/.classpath': an unversioned file 
of the same name already exists.

How do I avoid this error? I thought of deleting the original project before doing the checkout, in which case I avoid this complaint. What are the consequences of an unversioned .classpath file? Unfortunately, upon the next use of Eclipse, the program gets confused and requires me to hit F5 in order to "synchronize" each file in the project. It seems that Eclipse cannot handle the case of a project tree that was deleted and rebuilt solely by subversion checkout. The F5 process is not only tedious since it has to be done for each .java file but also for the .properties file and it does not seem to support F5 (synchronize) for the .properties file.

Any insight into avoiding complaints in either subversion or Eclipse is being sought since each causes a problem for the other. (No I don't want to use the plug-in for the time being. I have read there are bugs in it. It would seem the command line should be sufficient and more reliable.)

Edit: It was suggested to use svn checkout --force. The problem remains that Eclipse will still require F5 on all files. I have upvoted hardmath's comment and will accept that as the answer if posted as one.


I would change my process in this way:

To be done once:

  1. create the repository
  2. create one directory in the repository
  3. checkout that directory over the source

No files are present in the repository yet, hence no error.

Then following commands:

  1. Svn Add/Delete the files you want to put under or remove from svn
  2. commit your changes

This works smoothly and is anyway what you would have to use under normal development so why not apply this process from the very beginning on.


I decided to use the following process from within a bash script:

svn import --depth=files projectPath/src/pathToJavaSource
svn import --depth=files projectPath/war
svn import --depth=files projectPath/war/WEB-INF

svn checkout --force --depth=files path

svn commit --depth=files path

The imports are to folders, hence they are bulk imports but I avoided indiscriminately importing the whole Eclipse tree. The three choices correspond to source code and what I consider to be similar to source code. The force option handles the "obstructing paths". The depth option is a restriction to avoid versioning certain Eclipse folders and Eclipse plug-in folders. Eclipse will require F5 to be used on checked-out files.

0

精彩评论

暂无评论...
验证码 换一张
取 消