You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Gary Hallmark <ga...@oracle.com> on 2010/06/10 20:42:04 UTC

can I use svn:externals instead of svn copy to create a tag?

All examples I have seen for tagging use svn copy (or svncopy -tag) to 
create a tag. If I want to make sure nobody can change the tag, I guess 
I could write a commit hook. But couldn't I use a versioned external 
definition to create the tag instead of svn copy? Seems this would 
better enforce that nobody can change the tag, since it isn't a copy at 
all. One downside would be that if the tag contains unversioned 
externals, I would not be able to pin them down, but I don't plan to 
have unversioned externals. Are there any other downsides?

Example:
trunk/
tags/
    X -r123 ^trunk version_1.0

Cheers,
  Gary

Re: can I use svn:externals instead of svn copy to create a tag?

Posted by David Weintraub <qa...@gmail.com>.
I already have a pre-commit hook that just does this. You can set an
"add-only" parameter which allows you to copy files into that
directory, but not modify files in that directory.

Take a look at it: http://dl.dropbox.com/u/433257/hooks.zip.

On Thu, Jun 10, 2010 at 4:42 PM, Gary Hallmark <ga...@oracle.com> wrote:
> All examples I have seen for tagging use svn copy (or svncopy -tag) to
> create a tag. If I want to make sure nobody can change the tag, I guess I
> could write a commit hook. But couldn't I use a versioned external
> definition to create the tag instead of svn copy? Seems this would better
> enforce that nobody can change the tag, since it isn't a copy at all. One
> downside would be that if the tag contains unversioned externals, I would
> not be able to pin them down, but I don't plan to have unversioned
> externals. Are there any other downsides?
>
> Example:
> trunk/
> tags/
>   X -r123 ^trunk version_1.0
>
> Cheers,
>  Gary
>



-- 
David Weintraub
qazwart@gmail.com

Re: can I use svn:externals instead of svn copy to create a tag?

Posted by Daniel Becroft <dj...@gmail.com>.
On Fri, Jun 11, 2010 at 6:42 AM, Gary Hallmark <ga...@oracle.com> wrote:
> All examples I have seen for tagging use svn copy (or svncopy -tag) to
> create a tag. If I want to make sure nobody can change the tag, I guess I
> could write a commit hook. But couldn't I use a versioned external
> definition to create the tag instead of svn copy? Seems this would better
> enforce that nobody can change the tag, since it isn't a copy at all. One
> downside would be that if the tag contains unversioned externals, I would
> not be able to pin them down, but I don't plan to have unversioned
> externals. Are there any other downsides?
>
> Example:
> trunk/
> tags/
>   X -r123 ^trunk version_1.0

You would still need to enforce (via a commit hook) that no-one can
modify the version_1.0 external definition to point to -r456 instead.
Not sure how much simpler (or more difficult) this would be over
having standard folders.

BTW, I think the definition you might want to use is ^trunk@123,
rather than -r123 ^trunk, but I could be wrong.

Cheers,
Daniel B.

Re: can I use svn:externals instead of svn copy to create a tag?

Posted by Rob van Oostrum <rv...@gmail.com>.
On Thu, Jun 10, 2010 at 4:42 PM, Gary Hallmark <ga...@oracle.com>wrote:

> All examples I have seen for tagging use svn copy (or svncopy -tag) to
> create a tag. If I want to make sure nobody can change the tag, I guess I
> could write a commit hook. But couldn't I use a versioned external
> definition to create the tag instead of svn copy? Seems this would better
> enforce that nobody can change the tag, since it isn't a copy at all. One
> downside would be that if the tag contains unversioned externals, I would
> not be able to pin them down, but I don't plan to have unversioned
> externals. Are there any other downsides?
>
> Example:
> trunk/
> tags/
>   X -r123 ^trunk version_1.0
>
> Cheers,
>  Gary
>

The primary downside to this that I see, is that you won't be able to
address a tag via URL (e.g. for the purpose of creating a branch), because
the tags' paths will only exist in a working copy, and you probably don't
want to checkout all of /tags.