Conveniently move a class to a different package in eclipse without borking svn

非 Y 不嫁゛ 提交于 2019-11-30 04:46:26

I use Subclipse and it does support moving files between packages

I've been experimenting, and think I've found the way:

1) Tortoise-move the file using the right-click-drag context menu (or whatever SVN method you want).

2) Use the windows filesystem to move it back.

3) Drag-move the file in Eclipse to update all the references.

4) Commit - it shows as a delete/add, but it saves the history, and it does change the package references in one commit (keeping each commit buildable).

Old question, but I keep returning to it, so this is my documentation!

Yuval's right. This sounds like a (very unfortunate!) deficiency in Subversive. (having no experience with Subversive I can't say for sure) Subclipse definitely handles this properly by hooking into the right APIs in Eclipse.

You can not do both at the same time because moving the files alone is not enough. The files need to be modified in order for your code to be compilable again. So refactor with Eclipse and let Subclipse do its magic (remove old files, add new files) after the move.

If you let Eclipse do the refactoring then surely it will make changes in the actual files which SVN should pick up when you commit the root directory? I don't think a move will cut it though, SVN will have to pick up that the file is missing from its original directory but re-add it from the new directory. It's a sticky situation, I wouldn't know what the best method is, I'd just do the refactoring and then commit the root personally, even though it wouldn't be a move.

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