Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When making a branch in TortoiseSVN, what do "head", "working copy", and "specific" revisions mean?

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 http://img25.imageshack.us/img25/3747/svnfile.jpg

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

alt text http://img34.imageshack.us/img34/8079/svn2.jpg

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 !

like image 491
Asad Avatar asked Jan 17 '10 12:01

Asad


4 Answers

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.

like image 186
John Feminella Avatar answered Oct 26 '22 23:10

John Feminella


  • 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).
like image 45
Stefan Avatar answered Oct 27 '22 00:10

Stefan


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.

like image 29
Alexander Gessler Avatar answered Oct 27 '22 01:10

Alexander Gessler


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).

like image 22
Ken Liu Avatar answered Oct 27 '22 00:10

Ken Liu