You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Mayank Gupta <ma...@induslogic.com> on 2006/07/27 14:31:18 UTC

Locks on the repository

Hi All,

 

Please let me know if I can lock the entire subversion repository with a
single command. What I understand that "svn lock" locks a single file but
not a URL or entire repository.

 

Or let know if there is some other way to perform the above steps.

 

With Regards,

Mayank


Re: Locks on the repository - Further information

Posted by Les Mikesell <le...@gmail.com>.
> When I run the build, it takes around 30 minutes. In the build process I
> first do the checkout of source code, and then perform the build operations
> in sequence. My last build operation is a checkin in which I checkin some of
> the files created by the build process.
>
> To explain it further:
> Before starting the build, subversion head number is 800.
> Now I run the build and finally checkin few files and head number becomes
> 801. We consider 801 as the build release number.

That seems like a bad plan to start with - what if the build fails in a way that
needs another developer's checkin to fix?

> But if somebody else comes in between and checks in his source code, he will
> occupy 801 and I will get 802 (802 will be the release) and thus he will
> corrupt the whole build process because 802 does not have the exact release
> files.
>
> So I want to solve this problem by locking the repository for the build
> time. I can add repository lock/unlock steps in my build process.

I think a better approach here would be to copy the head to a build branch
before starting the build.  This allows development to continue on the trunk
without affecting your snapshot and lets you make as many changes as you
need to make the build complete.  Then when the build is finished, copy it
to a tag with a name that you control for the release.  That way nothing has
to stop and nothing is changed accidentally.

---
  Les Mikesell
   lesmikesell@gmail.com

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

Re: Locks on the repository - Further information

Posted by Nico Kadel-Garcia <nk...@comcast.net>.
Mayank Gupta wrote:
> Hi,
>
> The reason is following:
>
> When I run the build, it takes around 30 minutes. In the build
> process I first do the checkout of source code, and then perform the
> build operations in sequence. My last build operation is a checkin in
> which I checkin some of the files created by the build process.
>
> To explain it further:
> Before starting the build, subversion head number is 800.
> Now I run the build and finally checkin few files and head number
> becomes 801. We consider 801 as the build release number.
>
> But if somebody else comes in between and checks in his source code,
> he will occupy 801 and I will get 802 (802 will be the release) and
> thus he will corrupt the whole build process because 802 does not
> have the exact release files.

Make a build branch from revision 800, and build and check back in *that*. 
When you're done, you need to merge your changes back in.

No one else should be active in each other's branches in this kind of setup.

> So I want to solve this problem by locking the repository for the
> build time. I can add repository lock/unlock steps in my build
> process.
>
> With Regards,
> Mayank

That seems workable, but not ideal. 

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

Locks on the repository - Further information

Posted by Mayank Gupta <ma...@induslogic.com>.
Hi,

The reason is following:

When I run the build, it takes around 30 minutes. In the build process I
first do the checkout of source code, and then perform the build operations
in sequence. My last build operation is a checkin in which I checkin some of
the files created by the build process.

To explain it further:
Before starting the build, subversion head number is 800.
Now I run the build and finally checkin few files and head number becomes
801. We consider 801 as the build release number.

But if somebody else comes in between and checks in his source code, he will
occupy 801 and I will get 802 (802 will be the release) and thus he will
corrupt the whole build process because 802 does not have the exact release
files.

So I want to solve this problem by locking the repository for the build
time. I can add repository lock/unlock steps in my build process.

With Regards,
Mayank

-----Original Message-----
From: Erik Hemdal [mailto:erik@comprehensivepower.com] 
Sent: Thursday, July 27, 2006 8:53 PM
To: 'Mayank Gupta'; users@subversion.tigris.org
Subject: RE: Locks on the repository



> Hi All,
 
> Please let me know if I can lock the entire subversion repository with a
single command. What I understand  
> that "svn lock" locks a single file but not a URL or entire repository.
 
> Or let know if there is some other way to perform the above steps.

What do you want to accomplish by locking the repository?  This might
influence the answer.  

For instance, if I want to prevent access to the repository while I work on
our server, I can prevent xinetd from starting the Subversion server, which
locks out users.  If you are trying to obtain a reliable backup, it might
not be necessary to lock anything at all.

Erik


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

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

RE: Locks on the repository

Posted by Erik Hemdal <er...@comprehensivepower.com>.

> Hi All,
 
> Please let me know if I can lock the entire subversion repository with a
single command. What I understand  
> that "svn lock" locks a single file but not a URL or entire repository.
 
> Or let know if there is some other way to perform the above steps.

What do you want to accomplish by locking the repository?  This might
influence the answer.  

For instance, if I want to prevent access to the repository while I work on
our server, I can prevent xinetd from starting the Subversion server, which
locks out users.  If you are trying to obtain a reliable backup, it might
not be necessary to lock anything at all.

Erik


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