views:

5633

answers:

5

In Clearcase I can generate a "label" for a given set of files and always go back to that label to regenerate all the files as they were when I generated the label.

How do I do this in Subversion? I'm using the Tortoise front end [Windows] to SVN and I'm not sure how to accomplish this functionality.

+2  A: 

Tags are the equivalent of labels in Subversion.

Tags are created via the copy command, or in the TortoiseSVN Branch/Tag menu option.

By convention, tags are copied to a tags path in the Subversion repository.

BTW, the TortoiseSVN help is really well done - the Daily Use Guide is very helpful.

Ken Gentle
A link to that Daily Use Guide?
Svish
@Svish, the Daily Use Guide is chapter 5 of the TortoiseSVN helpfile (which should have been installed with the package). It covers all the most common operations you'd do in an average day. (And yes, it and the whole docs are extremely good).
John C
@John: Thanks :)
Svish
A: 

Use svn copy and create a copy in the tags folder. This is more convention than anything else, but most repositories will have folders called trunk, tags, and branches.

Don't worry about creating extra copies - it's not really duplicating all those files -- copies are cheap in subversion.

For example:

svn copy /trunk/foo /tags/foo-1.0
jmanning2k
+1  A: 

You could do this two ways.

  1. Commit the current state of files, now you can always revert to this revision and get that state of your files back

  2. Create a new tag with your current files, and continue working in the trunk.

Javache
+4  A: 

The equivalent to a label in subversion is a "tag" (i.e. creating a branch in a folder for the specific purpose of marking a revision). In the repo-browser, right click, "Copy to..." and then pick a new folder name.

http://svnbook.red-bean.com/en/1.5/svn.branchmerge.tags.html

crashmstr
+4  A: 

In fact in SVN every commit creates a 'label'. You can go back to every revision (commit) at any moment.

There is no difference between a branch and a tag in theory. Just that a branch is developed further and merged with commits from different developers whereas noone should ever commit to a tag.

Tags are normally given a more verbose name such as 'RC 1.5 - the day when it finally seemed to be stable'.

That explains why 'Create branch/tag' in Tortoise are one.

And essentially svn just creates a copy of the last revision into another directory (e.g. tags). This copy is of course not a full copy but a normal diff, therefore the continuous revision numbers.

tharkun
I've seen "every commit creates a 'label'" said before, but I don't consider 3876 or any other system generated number to be a 'label'. Labels (or tags, same thing) give user defined meanings to revisions. Revision numbers are not labels.
crashmstr
When you commit you can choose to add a note or "label" along with the files and commit number. I assume this is what tharkun is talking about.
jacko