5

I am a complete newb to Subversion, but am trying to get past the frightening shadow of SourceSafe. So I'm learning, trying to teach myself what's what, and I've come across some roadblocks I don't quite understand yet.

SVN 1.7.3 is up and running on a local Linux box. AnkhSVN is installed within my VS 2010 setup. VS/AnkhSVN can talk to my repository. So I started experimenting with some very simple Console projects to get started. I created the trunk, branches, and tags directories as suggested in the guidance I've found so far.

I created a new Console solution, and allowed Ankh to create that project in my repository under the recommended "trunk" folder. After adding nothing more than a "Hello, World" line to Program.cs, I commit the changes to trunk. That works...so far, so good...

I'm now wanting to pretend I'm working on a private branch, so I select Subversion->Branch Project... from "trunk" and the "Head/Latest" version, checking "Switch to Branch after creation." That seems to go well.

Problem 1.

Now here's where things get dicey. I decide to add a single source file to the project in my private branch, adding the file, but I cannot get the file to move from my private branch to trunk. Merging/reintegrate doesn't work. Update doesn't work. Switch doesn't work. Now, after trying a switch from the branch to the trunk, VS tells me my project file is corrupt and can't be loaded.

Obviously, I've done something terribly wrong, but I don't know what. It appears I just need to get a trunk working copy, then do a merge, but how do I do that in my VS project folder setup?

Problem 2

My next problem, or question, which may be part of Problem 1, is understanding how Subversion-managed projects should be structured on the Visual Studio side. Its much clearer to me on the Unix side that you can pull a project into a local folder, but its not at all clear how the typical directory structure of a VS project is supposed to be affected by Subversion. Should the trunk and branches folders be duplicated on the local Visual Studio box as well? If I "switch" from trunk to a private branch (or vice-versa), is the intent that the corresponding files should be going into the same set of VS folders, or should there be a corresponding set for the branches and for the trunk?

Problem 3 This is more of a newbie SVN question, but when SVN tells me there are conflicts, I don't yet understand how to resolve them. Does the ankhSVN plug-in have special tools to resolve conflicts, or do I need to fix them on the host server with the full svn tool? If so, what's is the "most typical" kind of conflict to resolve?

Kara
  • 6,115
  • 16
  • 50
  • 57
David W
  • 10,062
  • 34
  • 60
  • I'm totally ok if you accept the other answer. – malenkiy_scot May 07 '12 at 13:07
  • Thanks - went ahead and accepted yours as you gave me some extra depth in your response. Do wish SO would allow for something like "runner-up" answer or a "props" for other good answers, tho :) Have a blessed day. – David W May 07 '12 at 13:24

2 Answers2

2
  1. Did you add and commit the file?

  2. You could use switch to the keep same folder, as given in the example here or you could have two separated folders for your trunk and branch. It's up to you and what works for your project. It may be better to use switch if your project has to be in a certain path to work, for example a Web service.

  3. Unfortunately I don't have Ankh in front of me, but you should be able to edit or resolve conflicts with a tool built into Ankh, but you could change the configuration to use a 3rd party tool as well. Documentation here.

WhiteKnight
  • 4,938
  • 5
  • 37
  • 41
  • Thanks, WhiteKnight. The physical resolution of conflicts can be done in Ankh; my question was more of why Ankh seemingly wasn't able to merge reintegrate my branch with the trunk. As I noted in response to the other reply, I thought perhaps this just might be a limitation of Ankh, so I downloaded TortoiseSVN on my client box and was able to reintegrate on the first try. I'm still learning, but I think what I've learned so far is that AnkhSVN by itself isn't adequate as a "true" SVN client. – David W Apr 20 '12 at 12:08
  • Historically AnkhSVN hasn't had the ability to perform all the tasks for Subversion, but it is now able to perform most tasks. I generally perform most of my work through TortoiseSVN, but use AnkhSVN to provide a view into what is happening in source control. – WhiteKnight Apr 20 '12 at 12:31
2

First thing to do: read at least the first two chapters of Version Control with Subversion and play with the examples. To do the latter it's better to use a command-line client, such as Slik SVN.

AnkhSVN on its own is not enough for an SVN client - it's just a convenience tool for integrating SVN into VS. So if you'd like to use a GUI client (in addition to a command-line client, that IMHO is a must in any case), then most popular one for Windows is Tortoise SVN.

(Actively) reading Version Control with Subversion will help you with all your current questions, but here are some initial thoughts:

Problem 1 Did you commit your branch? You can make sure by running svn info [repo_url]/branches/[your_branch]

Problem 2 It seems that there is some misunderstanding on you part: SVN also 'pulls' (the term is 'check out') your files locally. Read the book!!!

In general, your SVN structure should reflect your folder structure, not vice versa. Also generally you work on only one branch at a time, and have only one branch checked out. When you need to work on another branch you do 'svn switch'. It conserves space. Now, of course you can check out all of your repository starting at the repo root, but why would you do that? (I can think of such situations, but they are more concerned with repository maintenance, rather than with a regular workflow).

Problem 3 Conflicts - not even worth talking about until you read the book.

I hope this will point you in the right direction. Reading the first two chapters of the book should take you anywhere from couple of hours to couple of days.

malenkiy_scot
  • 16,415
  • 6
  • 64
  • 87
  • Thanks for the comments and tips. Branches were definitely committed. Did that before I tried to reintegrate them back to trunk. I have also realized that AnhkSVN by itself isn't "big" enough to serve as a full SVN client, so I installed TortoiseSVN and that's already helped. I pulled down a fresh copy of Trunk and reintegrated my branch from here, and the additional source file was added immediately. I will also read the book further and get more insights. Thanks for the education! – David W Apr 20 '12 at 12:05
  • > _I installed TortoiseSVN_ I still think that to learn SVN properly you need the command-line client. The learning curve is a bit steeper, but you'll gain deeper insight. Then you'll mostly use the GUI client, except for some advanced cases. Good luck! – malenkiy_scot Apr 20 '12 at 12:41
  • malenkiy_scot, Although it probably belies my age, I much prefer a command-line interface to most tools for that very reason - it usually draws you much closer to understanding how things are running under the hood. Hoping to do more reading and experimentation this weekend, maybe some of the info will find some cracks into the ol' gray matter :) Thanks for the help. – David W Apr 20 '12 at 21:06
  • OK :) Just thought about something else: SVN seems to be going out of vogue. Git (or Mercurial) is all the rage now. It's not much of an option for my team - too many people would have to switch, and as SVN is adequate the cost of switching outweighs the benefits, but it may make sense to you / your team. – malenkiy_scot Apr 21 '12 at 17:09
  • 1
    Thanks for the extra information. I've been reading about Git, but I think at the moment the SVN tools may be a bit more robust. I have to make the right pitch, because this may be the only shot I get to guide our group away from Source Safe! – David W Apr 21 '12 at 20:13