
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Tags
|
69
Creating a Simple Tag
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, then make a copy of it:
$ 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 351.
This example assumes that a /calc/tags directory already exists. After the copy com-
pletes, the new release-1.0 directory is forever a snapshot of how the project looked
in the
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 350 of /calc/trunk is exactly the snapshot you want, you can specify it by
passing
-r 350 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 ...