The Linux Page

Marking a Subversion tree with a label

Subversion Labels?

At this time, Subversion does NOT support simple labels.

This would be neat, but it simply isn't available.

What I usually want to do is mark all the files in a folder with a label to mark that point in time as a specific version. There is no feature in Subversion to do that.

There are many different things you can do to circumvent this problem.

What most people tell you to do is create a "Tag" (another name for a label), which comes down to creating a new branch. Really not what I want to do! Creating new branches all the time consumes some disk space each time and plus if I want to work in the exact same folder, just be able to go back to a given version... why should I have a branch?!

Anyway, if you want to use that solution, there is the command:

svn copy from-this-version to-that-version

Note that I was looking into that because I have a branch sswf-1.8.4 and one sswf-1.8.5. I'm working in both branches and once in a while I want to merge the changes from 1.8.4 to 1.8.5. Why would I want to create yet another branch?! I'm not too sure. A label would help me mark the version I already merged from 1.8.4 to 1.8.5 so that way I can avoid problems with conflicts that I have already resolved... but that is not really supported.

Create a TAG File

Now, the other way I can think of is for you to create a TAG file (or whatever name you'd like, could be Label!) And use that file as the label by changing it and then doing a commit of the file. Do not change the file again until you do your merge. And that way, each log of that TAG file represent your label (and the revision # of that TAG file represents the revision # you want to use to do your merge.)

gvim TAG
svn add TAG
svn log TAG

These lines let you create a TAG file, add it to the repository and then check its log to see the revision #'s you are interested in.

The good ol' way!

Another method requires you to have a piece of paper and a pencil (wow!) Do an svn update and look at the revision number. Write it down on your piece of paper (if the pencil seemingly does not work, you may want to remove the cap first and try again?) Then, just make sure you do not lose that piece of paper (have kids?)

If you have another idea, let me know! Just post a comment below. Thank you. :glasses: