开发者

Tortoise SVN tree conflict with myself

开发者 https://www.devze.com 2023-01-01 14:31 出处:网络
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:

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开发者_如何学C it does happen, is there a more elegant way of fixing the problem than by deleting the whole folder and updating again?


  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.


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


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.

0

精彩评论

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

关注公众号