views:

253

answers:

4

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?

+5  A: 

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.

ctford
Building a DLL definitely sounds like a better solution here. Good call.
antik
I'm starting to think that a DLL would be better too. As a test, I just moved a few files to a new shared folder, and then had to update two projects by removing and re-adding the files. Wasted even more time because I forgot to re-add a designer file.
Tom Bushell
A: 

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

ram
If you're using both at the same time, changes you make in Tortoise will not be reflected in Ankh until you hit refresh on the pending changes pane. Your Update is simply causing this refresh. Update before commit is not a bad idea though: you should compile if you get new code before you commit as well :)
antik
What kind of problems where those? It's not very useful to mention that fact without indicating what it had to do with moving/renaming directories?
Sander Rijken
You should do an update before committing with every subversion client, as update doesn't track moves. (So committing soon after moving is recommended). But what were your problems? AnkhSVN 2.1 tracks my file moves just fine.. And every subversion client tracks moves in the same way. And Subversion 1.7 will resolve most casing change issues on Windows.
Bert Huijben
@antik: I never said that I am using both of them at the same time
ram
A: 

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.

Aaronaught
http://svnbook.red-bean.com/en/1.0/re18.html Moving is a COPY then a DELETE. Copy being quite distinct from add. SVN is an improvement over CVS which used to be unable to recognize previous history of a file after moving it so you'd truncate your changelog, IIRC.
antik
+5  A: 

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.

antik
Didn't know you could that. Much easier than my way!
Aaronaught
@antik - Thanks! That was the missing piece of info. I now see it's in the help (section 4.12) - somehow missed it the last time I looked.
Tom Bushell
One additional point - when adding files to a new directory, I found I needed to commit the new, empty folder to SVN before dragging the files. Otherwise, the Tortoise options will not be shown on the menu when you drop the files in the new folder.
Tom Bushell
@Tom- very welcome: glad it got fixed up. You're right about adding + committing the folder first: your SVN doesn't understand what a move into an un-versioned folder is because to it, that folder does not exist. By adding first, you're later asking for a move to a known destination.
antik