Search code examples
visual-studiosvnsolution

Subversion: How to organize svn tags for Visual Studio solutions -- or -- How to version an entire VS solution


I have the following directories in my Subversion repository for a Visual Studio solution:

  • ProjectName
    • tags
    • branches
    • trunk
      • MySolution.sln
      • MyProject1 (dir)
      • MyProject2 (dir)

If I update MyProject1 from version 1.0.0 to 2.0.0, should I copy everything in trunk to a new directory under tags, or should I only copy everything in trunk/MyProject1 to a new directory under tags?

And, if the former is the correct way of doing things, how do I version an entire Visual Studio solution?

Thanks.


Solution

  • Take a look at the svn guide to understand basic versioning concepts.

    Trunk is the main line of development so you can update from version 1.0.0 to 1.0.1, 2.0.0 etc.

    Branch is a copy of your trunk to develop a feature or something else without affecting the Trunk. You can merge at any time the branch code to the trunk code or throw it away.

    Tag is a snapshot at a given time of your trunk o branch.

    In your case you can update from 1.0.0.0 to 2.0.0.0 in trunk and maybe keep a snapshot by tagging your 1.0.0.0 release (copying all trunk to a tag named 1.0.0.0).

    First you can checkout ProjectName to your local disk, for example c:\working\ProjectName. In this way you have this first local structure:

    • ProjectName
      • tags
      • branches
      • trunk
        • MySolution.sln
        • MyProject1 (dir)
        • MyProject2 (dir)

    When you reach your 1.0.0.0 release tag it to have this structure:

    • ProjectName
      • tags
        • 1.0.0.0
          • MySolution.sln
          • MyProject1 (dir)
          • MyProject2 (dir)
      • branches
      • trunk
        • MySolution.sln
        • MyProject1 (dir)
        • MyProject2 (dir)

    Then update to 2.0.0.0 and so on:

    • ProjectName
      • tags
        • 1.0.0.0
          • MySolution.sln
          • MyProject1 (dir)
          • MyProject2 (dir)
        • 2.0.0.0
          • MySolution.sln
          • MyProject1 (dir)
          • MyProject2 (dir)
      • branches
      • trunk
        • MySolution.sln
        • MyProject1 (dir)
        • MyProject2 (dir)

    At any time you can work on trunk or release 1 or 2 (maybe for debugging or applying patches)