Once again, svn copy comes to
the rescue. If you want to create a snapshot of /calc/trunk exactly as it looks in the
HEAD revision, make a copy of
$ svn copy http://svn.example.com/repos/calc/trunk \ http://svn.example.com/repos/calc/tags/release-1.0 \ -m "Tagging the 1.0 release of the 'calc' project." Committed revision 902.
This example assumes that a /calc/tags directory already exists. (If it
doesn’t, you can create it using svn
mkdir.) After the copy completes, the new release-1.0 directory is forever a snapshot
of how the /trunk directory looked
HEAD revision at the time you
made the copy. Of course, you might want to be more precise about
exactly which revision you copy, in case somebody else may have
committed changes to the project when you weren’t looking. So if you
know that revision 901 of /calc/trunk is exactly the snapshot you want,
you can specify it by passing
-r 901 to the svn copy command.
But wait a moment: isn’t this tag creation procedure the same procedure we used to create a branch? Yes, in fact, it is. In Subversion, there’s no difference between a tag and a branch. Both are just ordinary directories that are created by copying. Just as with branches, the only reason a copied directory is a “tag” is because humans have decided to treat it that way: as long as nobody ever commits to the directory, it forever remains a snapshot. If people start committing to it, it becomes a branch.
If you are administering a repository, there ...