Tortoise SVN tree conflict with myself
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:
- the file in its original location has been deleted, but in tortoise is marked as missing
- 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).
- Why is this happening?
- Is there a way to avoid it happening?
- If开发者_如何学C it does happen, is there a more elegant way of fixing the problem than by deleting the whole folder and updating again?
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).
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.
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:
- open new clean checkout into a different folder
- svn deleting and committing the broken 'newpath\to\folder' from clean checkout
- select 'oldpath\folder' r-click drag and svn move to new location
- immediately commit change with no other operations in the middle
- go to broken checkin 'oldpath\folder' and manually copy files which were dropped or left behind to 'newpath\to\folder'
- 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.
精彩评论