You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Ron Olson <ta...@gmail.com> on 2006/11/06 23:09:15 UTC

Lock a branch

Hi all-

I've been going through the Subversion book (printed the whole thing out)
but haven't found anything that really answers this question: Can I lock a
branch/tag so that no changes can be made to it? I am using this particular
repository for documents that become a printed catalog; once the docs are at
the printer, they should never, ever be changed again; I need to make sure
that I can always print out this branch and have exactly what was sent to
the publisher.

I can't rely on anybody reading my comments ("DO NOT CHANGE!"), I can lock
the documents but others can steal the locks, and I was thinking of writing
a hook script to prevent a commit to the branch taking place, but it seems
...silly to have to modify it for each new branch.

Is there any good, standard ways of doing this?

Thanks,

Ron

Re: Lock a branch

Posted by Erik Huelsmann <eh...@gmail.com>.
On 11/7/06, Joseph Mocker <mo...@fakebelieve.org> wrote:
> I vaguely recall reading in the mailing list archives about this. From
> what I recall, there is no support for making a branch/tag read-only.
> The thread was in the context of creating a new feature that would allow
> you to "tag" files in a read-only manner. I forgot what the person had
> called it.
>
> I think you are on to an interesting approach with a hook script. So
> that you wouldn't have to modify the script for each new branch/tag,
> couldn't you just identify a set of operations that are allowed on say
> tags/, that only permit the "creation" of files, but not modification?

svnperms.py (http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/)
knows Create (calls it add), Update and Delete (calls it remove)
operations. Read can't be controlled by hookscripts.

So, with svnperms.py you can manage pretty much all CUD access
control. You could even have 1 user who *is* still allowed to UD the
tag.

bye,

Erik.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Lock a branch

Posted by Joseph Mocker <mo...@fakebelieve.org>.
I vaguely recall reading in the mailing list archives about this. From 
what I recall, there is no support for making a branch/tag read-only. 
The thread was in the context of creating a new feature that would allow 
you to "tag" files in a read-only manner. I forgot what the person had 
called it.

I think you are on to an interesting approach with a hook script. So 
that you wouldn't have to modify the script for each new branch/tag, 
couldn't you just identify a set of operations that are allowed on say 
tags/, that only permit the "creation" of files, but not modification?

  --joe

Ron Olson wrote:
> Hi all-
>
> I've been going through the Subversion book (printed the whole thing 
> out) but haven't found anything that really answers this question: Can 
> I lock a branch/tag so that no changes can be made to it? I am using 
> this particular repository for documents that become a printed 
> catalog; once the docs are at the printer, they should never, ever be 
> changed again; I need to make sure that I can always print out this 
> branch and have exactly what was sent to the publisher.
>
> I can't rely on anybody reading my comments ("DO NOT CHANGE!"), I can 
> lock the documents but others can steal the locks, and I was thinking 
> of writing a hook script to prevent a commit to the branch taking 
> place, but it seems ...silly to have to modify it for each new branch.
>
> Is there any good, standard ways of doing this?
>
> Thanks,
>
> Ron

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Lock a branch

Posted by Gavin Baumanis <ga...@thespidernet.com>.
Abe et al,

Whilst Paul is correct and use seem to have handle on it now too, for  
people who might be new to SVN or stumble across the thread sometime  
later - let me offer the following;

Subversion does not treat ANY folder differently to any other folder.
The trunk / branches / tags folders are a naming convention to assist  
humans in managing their code.

As with all conventions, it is a guide - humans will ALWAYS make errors!

The convention says;
Do all your work in a directory named "trunk".
Do anything that might break the trunk in a branch (a sub-directory of  
the "branches" directory) - so as not to break the trunk with  
experimental code.
Use the "tags" directory for a snapshot in time of the trunk at a  
particular revision  - (File releases / some other milestone you want  
to track).

You may well use pre / post commit hooks and / or access controls that  
help control what users can or can't do in in a certain directory of  
the repository - but the hooks / access controls  can be attributed to  
any path.

Your repository MAY look like this;
trunk/
tags/
  |____ 2009010101/
  |____ 2009021301/
  |____ 2009021302/
  |____ r123456
  |____ r123500
branches/
  |____ experimentalFeatureBranch1/
  |____ experimentalFeatureBranch2/

The svn book is an absolutely tremendous document.
Written in very easy to read plain language with plenty of examples.

While "I" think everyone should read the whole book;
Try the following for any clarification;

http://svnbook.red-bean.com/nightly/en/svn.tour.importing.html#svn.tour.importing.layout
     for the "proposed" directory conventions
     and
http://svnbook.red-bean.com/nightly/en/svn.tour.cycle.html
     everyday usage
     and
http://svnbook.red-bean.com/nightly/en/svn.branchmerge.html
     does a fabulous job of explaining / demonstrating the use of  
branches, how and why you would bother.

Gavin.


On 08/04/2009, at 3:23 AM, Subversionator wrote:

> Ok, corrected.  I'm assuming that that semantic is created on the  
> repository
> side; that there's a pre-commit hook implemented, that distinguishes  
> between
> tags and branches and rejects the commit.
>
> http://svnbook.red-bean.com/nightly/en/svn.reposadmin.create.html#svn.reposadmin.create.hooks
>
> abe
>
>
> Paul Koning-4 wrote:
>>
>>>>>>> "Subversionator" == Subversionator  <abraham.a.ehrlich@jpmorgan.com 
>>>>>>> >
>>>>>>> writes:
>>
>> Subversionator> Move the branch to a tag.  In other words, a branch
>> Subversionator> is a series of revisions under the branch directory.
>> Subversionator> A tag is associated with a particular revision.  So
>> Subversionator> if you svn mv URL/branches/yourbranch
>> Subversionator> URL/tags/yourtag it won't be editable anymore.
>>
>> Not true.
>>
>> Subversion just deals with path names.  "branch" and "tag" are just
>> naming conventions, they have no distinct semantics.  In particular,
>> you can commit new revs to any pathname so long as the access  
>> controls
>> say that you can.
>>
>> If you want to have tags in the sense of "this thing can be created
>> but once created can't be modified" that's easy, just set up access
>> controls to disallow writes other than creates.  But you have to do
>> that, Subversion doesn't.
>>
>>      paul
>>
>> ------------------------------------------------------
>> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1580038
>>
>> To unsubscribe from this discussion, e-mail:
>> [users-unsubscribe@subversion.tigris.org].
>>
>>
>
> -- 
> View this message in context: http://www.nabble.com/Lock-a-branch-tp7209400p22934082.html
> Sent from the Subversion Users mailing list archive at Nabble.com.
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1580333
>
> To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org 
> ].

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1586485

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: Lock a branch

Posted by Subversionator <ab...@jpmorgan.com>.
Ok, corrected.  I'm assuming that that semantic is created on the repository
side; that there's a pre-commit hook implemented, that distinguishes between
tags and branches and rejects the commit.

http://svnbook.red-bean.com/nightly/en/svn.reposadmin.create.html#svn.reposadmin.create.hooks

abe


Paul Koning-4 wrote:
> 
>>>>>> "Subversionator" == Subversionator  <ab...@jpmorgan.com>
>>>>>> writes:
> 
>  Subversionator> Move the branch to a tag.  In other words, a branch
>  Subversionator> is a series of revisions under the branch directory.
>  Subversionator> A tag is associated with a particular revision.  So
>  Subversionator> if you svn mv URL/branches/yourbranch
>  Subversionator> URL/tags/yourtag it won't be editable anymore. 
> 
> Not true.
> 
> Subversion just deals with path names.  "branch" and "tag" are just
> naming conventions, they have no distinct semantics.  In particular,
> you can commit new revs to any pathname so long as the access controls
> say that you can.
> 
> If you want to have tags in the sense of "this thing can be created
> but once created can't be modified" that's easy, just set up access
> controls to disallow writes other than creates.  But you have to do
> that, Subversion doesn't.
> 
>       paul
> 
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1580038
> 
> To unsubscribe from this discussion, e-mail:
> [users-unsubscribe@subversion.tigris.org].
> 
> 

-- 
View this message in context: http://www.nabble.com/Lock-a-branch-tp7209400p22934082.html
Sent from the Subversion Users mailing list archive at Nabble.com.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1580333

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: Lock a branch

Posted by Paul Koning <Pa...@dell.com>.
>>>>> "Subversionator" == Subversionator  <ab...@jpmorgan.com> writes:

 Subversionator> Move the branch to a tag.  In other words, a branch
 Subversionator> is a series of revisions under the branch directory.
 Subversionator> A tag is associated with a particular revision.  So
 Subversionator> if you svn mv URL/branches/yourbranch
 Subversionator> URL/tags/yourtag it won't be editable anymore. 

Not true.

Subversion just deals with path names.  "branch" and "tag" are just
naming conventions, they have no distinct semantics.  In particular,
you can commit new revs to any pathname so long as the access controls
say that you can.

If you want to have tags in the sense of "this thing can be created
but once created can't be modified" that's easy, just set up access
controls to disallow writes other than creates.  But you have to do
that, Subversion doesn't.

      paul

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1580038

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: Lock a branch

Posted by Subversionator <ab...@jpmorgan.com>.
Move the branch to a tag.

In other words, a branch is a series of revisions under the branch
directory.  A tag is associated with a particular revision.  So if you
svn mv URL/branches/yourbranch  URL/tags/yourtag
it won't be editable anymore.
-- 
View this message in context: http://www.nabble.com/Lock-a-branch-tp7209400p22933547.html
Sent from the Subversion Users mailing list archive at Nabble.com.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1579881

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

Re: Lock a branch

Posted by Erik Huelsmann <eh...@gmail.com>.
On 11/7/06, Ron Olson <ta...@gmail.com> wrote:
> Hi all-
>
> I've been going through the Subversion book (printed the whole thing out)
> but haven't found anything that really answers this question: Can I lock a
> branch/tag so that no changes can be made to it? I am using this particular
> repository for documents that become a printed catalog; once the docs are at
> the printer, they should never, ever be changed again; I need to make sure
> that I can always print out this branch and have exactly what was sent to
> the publisher.
>
> I can't rely on anybody reading my comments ("DO NOT CHANGE!"), I can lock
> the documents but others can steal the locks, and I was thinking of writing
> a hook script to prevent a commit to the branch taking place, but it seems
> ...silly to have to modify it for each new branch.
>
> Is there any good, standard ways of doing this?

Did you have a look at svnperms.py
(http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/) ? It does
exactly what you want and *lots* more.

HTH,

Erik.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org