Question

I'm a fairly new user of Ankh and Tortoise. Currently ramping up on a VS2008 application suite that will have multiple .exe files, but with a lot of common code.

Currently, we're sharing code between .exe projects by putting source files in a "Shared" folder tree, and using "Add as link" in all the VS2008 projects that need to compile those files. (We started out with VisualSVN, but switched to Ankh because it dealt with linked files so much better.)

The problem we're running into is that we're still actively modifying the structure of the Shared folder tree - adding new folders, and moving existing files into them as the project evolves.

Have been mostly using Tortoise to change the directory structure, but keep running into problems - seems to get out of synch with the repository. We get error messages that say files are missing, or about tree conflicts.

I suspect the problem maybe that we sometimes do things in the wrong order - for example, forgeting to do an Update before moving directories around and then Committing - but am not sure.

So, my questions:

Which is the better tool for changing directory structures - Ankh or Tortoise?

For the preferred tool, what are the steps that must be performed, and in what order?

Was it helpful?

Solution

I find file-system level reorganization much easier using TortoiseSVN. However, there's a catch:

When moving files on the filesystem with TortoiseSVN:

  • Right click on the file
  • Drag it to its new destination
  • Release the right mouse button
  • Select "SVN Move" in the menu that is presented

If you just move files as will without doing the above,TortoiseSVN gets very confused and reacts as you're describing.

OTHER TIPS

Wouldn't it be easier to compile all the shared code to a DLL and then reference that from the other projects?

The problem is that you are strongly coupling the directory structure of the shared folder to all your projects - which is bound to cause you trouble, especially if it changes.

As for which svn client to use - I would advise using Tortoise for any change that is not purely within a single VS solution, and the way you are orginising your code suggests to me that the changes you are talking about relate to multiple solutions. Therefore, use Tortoise.

The key to easily moving things around in Tortoise is to use the right-click drag feature, which does an svn-aware move.

It's actually pretty tricky to reorganize directory structures, and it's neither a Tortoise nor an Ankh issue, it's just a Subversion issue.

The problem is that SVN understands add/delete but not "move" or "rename". So you have a folder with the same hidden .svn metadata inside it, but now moved to a different place, and this confuses SVN.

UPDATE: See antik's solution, it's better than messing about with the metadata by hand.

Tortoise !! I have had problems with AnkhSVN + VS2008. I usually do an "Update" before I do a "Commit"

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top