views:

244

answers:

4

A new user of Tortoise SVN, working over source control.

I have a Visual Studio solution which consists of 5 webAppliation projects. I need to take one out and work over it in a branch. When I try to branch it, It is asking me of one of these options

  • head revision in repository
  • specific revision in repository
  • working copy revision

alt text

Problem 1: What exactly are these ? I am confused with "head revision" and "working copy", as they appear same to me.

alt text

EDIT:

Problem 2: Why cant we branch from Repository GUI itself, (would be head revision) ?

Problem 3: Can you list the steps, needed to branch from a directory !

+8  A: 

The head revision in the repository is the most recent revision that has been committed to source control. Your working copy revision is the revision reflected by the current tree you have. Since people may have committed things while you're working, your working copy revision may not necessarily equal the HEAD revision.

When you branch, you're being asked to branch from a specific point. TSVN is asking you what you would like that point to be, and you have one of three choices:

  • where you're working from right now (your working copy revision)
  • where the repository is currently at right now (repository's HEAD revision)
  • some other arbitrary revision (specific revision)

Update: The OP added some additional questions that weren't part of the original, so I've amended my answer.

Why cant we branch from Repository GUI itself, (would be head revision) ?

The TortoiseSVN GUI doesn't represent the complete set of operations that is possible with Subversion. Subversion is really just a set of command-line tools, and TSVN is a wrapper around them. If you wanted to make a new branch completely on the server, just use:

svn copy svn://example.com/repo/trunk/ svn://example.com/repo/branches/1.4

Can you list the steps needed to branch from a directory?

The TortoiseSVN manual is quite explicit in how to do this. See here.

John Feminella
Thanks mate, do appreciate. Making the world easier place to live in!
Asad Butt
Glad it helped!
John Feminella
you can create a branch remotely, see my answer.
Ken Liu
+2  A: 

Your working copy can use a different revision as the repository's head revision. I.e. you check-out a particular revision which is not the newest or people commit to the repository while you're dealing with your working copy.

Alexander Gessler
+2  A: 
  • HEAD revision means the latest revision in the repository.
  • specific revision in the repository : here you can enter any revision you like. TortoiseSVN fill in the revision your working copy is at automatically. But you can of course change that (maybe you want to tag from a revision you created a week ago). The revision TortoiseSVN fills in automatically often is the revision your repository is at (i.e., HEAD), especially if you update often. But: While you are preparing to do the branch/tag, someone else could commit something which you might not want to have included in the branch/tag. That's why it's safer to use that revision instead of HEAD. However if you're sure that no one else is committing at this time, you can use HEAD here.
  • working copy : use this if you're working copy has local modifications which you want to have included in the branch/tag. This option is useful if you want to save your work in a branch (also known as shelving).
Stefan
+1  A: 

To answer question #2, you can create a branch from the TortoiseSVN GUI. Use the Repository Browser and find the path that you want to branch from and then right-click on the folder and select "Copy To...". The URL you enter will be the URL you want to branch to (typically rooted at the "branches" folder).

This will create a branch remotely in the repository without requiring you to create a working copy first. The reason the operation is called "Copy" instead of "Branch" is that a branching operation in svn is really the same creating a copy (it's not a distinct operation).

Ken Liu