Tortoise SVN tree conflict with myself

筅森魡賤 提交于 2019-12-04 04:29:24

问题


Has anyone had the experience of moving a file in tortoise and committing successfully, only to later commit a different change and be told of a tree conflict where:

  1. the file in its original location has been deleted, but in tortoise is marked as missing
  2. the file in its new location is there, but marked as already added.

(I use tortoise SVN, and we have client and server > 1.60)

Nobody else changed either the directory or the file (according to svn log).

  1. Why is this happening?
  2. Is there a way to avoid it happening?
  3. If it does happen, is there a more elegant way of fixing the problem than by deleting the whole folder and updating again?

回答1:


  1. Sounds like maybe you moved the file using the Windows Explorer "Move" command rather than the Tortoise "Move" command. The former just moves the file in the filesystem without updating the subversion tree (removing the old file from version control and linking the old file's history to the new one).

  2. Always use the TortoiseSVN "Move" command, or if you want a to move the file without history, then copy the file using Windows Explorer, add the new version with Tortoise, and then delete the old version with Tortoise.

  3. You can right-click on the parent folder of the old file, choose "Check for Modifications," and then delete the file marked as missing from version control.




回答2:


Sounds like you committed the file, but not the directories it was moved to/from. You need to commit the directories too.




回答3:


I got into a tree conflict by r-clicking on folder, selecting 'rename', and using "newpath\to\folder" as a parameter. After many rounds of failed cleanup commands and some other stuff I finally restored sanity by:

  1. open new clean checkout into a different folder
  2. svn deleting and committing the broken 'newpath\to\folder' from clean checkout
  3. select 'oldpath\folder' r-click drag and svn move to new location
  4. immediately commit change with no other operations in the middle
  5. go to broken checkin 'oldpath\folder' and manually copy files which were dropped or left behind to 'newpath\to\folder'
  6. add manually copied files as if they were new.

The seamless history chain is broken for the manually updated files, but at least I can continue work now.



来源:https://stackoverflow.com/questions/2951078/tortoise-svn-tree-conflict-with-myself

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