4

I am programming in Visual Studio 2010, using TortiseSVN and VisualSVN as my client to connect to SVN repositories.

I am having a bit of a frequent problem though with the whole SVN thing in general. One thing that keeps cropping up is that if I make changes to files - namely filenames, or move them to new folders, etc, I end up getting all kinds of conflicts with the repository and it just causes all sorts of strange errors.

I understand the importance of version control and check-in/check-out access like this, but what do most of you do to deal with this kind of thing? I mean, I've tried doing the whole 'Remove from Subversion', change my file, then 'Add to Subversion' thing, and it just doesn't seem to do the job very well. This is especially frustrating when working on web projects where filenames can change very frequently as a project evolves and becomes multifaceted.

Are there any standard ways to deal with this kind of thing, or is it just one of the flaws of SVN in general?

Ciel
  • 17,312
  • 21
  • 104
  • 199

3 Answers3

4

First I must admit that over the last years I stepped in every pitfall SVN offers. But in 99% it was my fault.

Common mistakes are:

  • Renaming a file and only changing lowercase.txt to UPPERCASE.txt (Windows only, to avoid this change the name to UPPERCASE1.txt first and than to rename to UPPERCASE.txt)
  • Using the explorer for Rename / Delete / Move operations (better use Tortoises Build-In methods
  • Cross Merge related conflicts

and some more I can't remember at the moment.

I haven't used visualsvn yet, but I think it is build on top of Tortoise. If you use Visual Studio, I would recommend ankhsvn http://ankhsvn.open.collab.net/ which has a great integration into visual studio and catches most mistakes you can make (all from within the IDE).

Jürgen Steinblock
  • 30,746
  • 24
  • 119
  • 189
1

Another tip: don't try to move/delete/rename a whole bunch of files AND directories in one commit. There is at least a couple of bugs in subversion server and client v1.6 (where both Ankhsvn and tortoise depend on) that screw up at least your working copy. A multiple commit approach will work (so first rename, commit, then move one folder, commit, etc).

rene
  • 41,474
  • 78
  • 114
  • 152
0

Subversion processes file name changes as a delete and an add, which can be somewhat problematic. It's just an inherent limitation of Subversion and is a part of why some of us have switched to using different version control systems.

Keith Irwin
  • 5,628
  • 22
  • 31
  • I've looked at Git, but it's just far too confusing. I had a lot of difficulty even getting it to function at all. What other alternatives are there? – Ciel Jan 17 '11 at 18:00
  • I don't really understand the downvote here. I think this was a perfectly legitimate response to the question I asked. – Ciel Jan 17 '11 at 18:10
  • @Stacey: I personally use Mercurial, but I should warn you that using a version control system like Git or Mercurial does require thinking about things just a little differently because they are distributed rather than centralized. But there are a lot of benefits, so personally, I think it's worthwhile. A good guide to getting started is Joel Spolsky's http://hginit.com/ – Keith Irwin Jan 18 '11 at 02:14
  • @Stacey: I should also add that I tend to use things from the command line, but there are also tools like TortoiseHg for Mercurial and there's Mercurial integration for Visual Studio as well (VisualHg or HgSccPackage). I have no experience working with any of these products, so don't take that as an endorsement, I just thought you might like to know. (There's also Git integration with Visual Studio according to this quesiton: http://stackoverflow.com/questions/507343/using-git-with-visual-studio ) – Keith Irwin Jan 18 '11 at 06:04