[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: branches and tags question

From: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2002-11-26 16:49:39 CET

pll@lanminds.com writes:

> Is that correct? If so, how do I create a 'tag', but then insure
> that it never changes? I understand that I can:
>
> svn cp http://path/to/repo/trunk http://path/to/repo/tag/tag-name
>
> However, that does not prevent me, or anyone else, from accidently
> checking out http://path/to/repo/tag/tag-name, making changes, and
> then re-committing it.
>
> Do I manually set the unix-level file permissions on the repository
> structure to read only after the creation or is there an svn mechanism
> to do this?

Take a look a doc/book/book/ch04.xml. I just finished rewriting the
chapter about branches and tags. Here's a relevant excerpt:

  "But wait a moment: isn't this tag-creation procedure the same
  procedure we used to create a branch? Yes, in fact, it is. The
  shocking truth is that in Subversion, there's no difference between
  a tag and a branch. Tags and branches are both just ordinary
  directories that are created by copying. As we mentioned earlier,
  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 are two approaches you
  can take to managing tags. The first approach is "hands off": as a
  matter of project policy, decide where your tags will live, and make
  sure all users know to how treat the directories they copy in
  there. (That is, make sure they know not to commit to them.) The
  second approach is more paranoid: you can use one of the
  access-control scripts provided with Subversion to prevent anyone
  from doing anything but creating new copies in the tags-area. The
  paranoid approach, however, isn't usually necessary. If a user
  accidentally commits a change to a tag-directory, you can simply
  undo the change as discussed in the previous section. This is
  version control, after all!"

If you're paranoid, install a pre-commit hook script to prevent a
commit to a tag. Look at tools/hook-scripts/commit-access-control.pl
or svnperms.py.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Nov 26 16:51:49 2002

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.