You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by "Srilakshmanan, Lakshman" <la...@police.vic.gov.au> on 2008/05/02 08:00:52 UTC
File lock issue
Hi All,
I find that a file with svn:needs-lock creates an exclusive lock only in
the branch I am working in.
My understanding was that creating an exclusive lock was to ensure
serialised update on files (eg word docs) because they cannot be merged.
Is there any way of preventing changes across branches till the latest
copy of the file is merged into the branch before editing or
alternatively is there a way of informing users on different branches
that the file has been edited and they need to update their copy before
proceeding.
Thanks for any help in advance.
Thanks
Lakshman
================================================================================================
EMAIL DISCLAIMER
This email and any attachments are confidential. They may also be subject to copyright.
If you are not an intended recipient of this email please immediately contact us by replying
to this email and then delete this email.
You must not read, use, copy, retain, forward or disclose this email or any attachment.
We do not accept any liability arising from or in connection with unauthorised use or disclosure
of the information contained in this email or any attachment.
We make reasonable efforts to protect against computer viruses but we do not accept liability
for any liability, loss or damage caused by any computer virus contained in this email.
================================================================================================
RE: File lock issue
Posted by "Harvey, Edward" <Ed...@patni.com>.
> Hi All,
> I find that a file with svn:needs-lock creates an exclusive lock only
> in the branch I am working in.
> My understanding was that creating an exclusive lock was to ensure
> serialised update on files (eg word docs) because they cannot be
> merged.
> Is there any way of preventing changes across branches till the latest
> copy of the file is merged into the branch before editing or
> alternatively is there a way of informing users on different branches
> that the file has been edited and they need to update their copy before
> proceeding.
I think you're confusing 2 terms here. "Branches" and "working copy."
If you checkout a bunch of files on your laptop, and your neighbor checks out a bunch of files on his/her laptop, you each have your own working copy.
If you copy "file1.doc" in the repository to "file1a.doc" within the repository, you've created a branch. The second file shares the same history with the first file, but both these files are in fact completely separate, and will probably never be the same again. If you lock "file1.doc" you are not changing anything at all about "file1a.doc" In fact, you can modify, commit, lock, delete, rename, whatever, file1.doc, and have no effect whatsoever on file1a.doc.
If you lock "file1.doc" and then your neighbor edits "file1.doc" your neighbor will find an error when he/she tries to commit.
If you assigned the "needs-lock" property to "file1.doc" (and you committed, and other people updated) then that file will be read-only until you "Get Lock." If a 2nd user tries to get lock, they will fail, because it's already locked. This does in fact ensure serialized commits, and avoid merging conflicts for that file.
This e-mail message may contain proprietary, confidential or legally privileged information for the sole use of the person or entity to whom this message was originally addressed. Any review, e-transmission dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you have received this e-mail in error kindly delete this e-mail from your records. If it appears that this mail has been forwarded to you without proper authority, please notify us immediately at netadmin@patni.com and delete this mail.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: File lock issue
Posted by Henrik Sundberg <st...@gmail.com>.
2008/5/2 Srilakshmanan, Lakshman <la...@police.vic.gov.au>:
> Hi All,
>
> I find that a file with svn:needs-lock creates an exclusive lock only in the
> branch I am working in.
> My understanding was that creating an exclusive lock was to ensure
> serialised update on files (eg word docs) because they cannot be merged.
>
> Is there any way of preventing changes across branches till the latest copy
> of the file is merged into the branch before editing or alternatively is
> there a way of informing users on different branches that the file has been
> edited and they need to update their copy before proceeding.
I find this troublesome. The needs-lock tries to solve two different problems.
Re: File lock issue
Posted by "Reedick, Andrew" <jr...@ATT.COM>.
> -----Original Message-----
> From: Andy Levy [mailto:andy.levy@gmail.com]
> Sent: Friday, May 02, 2008 7:06 AM
> To: Srilakshmanan, Lakshman
> Cc: users@subversion.tigris.org
> Subject: Re: File lock issue
>
>
> > Is there any way of preventing changes across branches till the
> latest copy
> > of the file is merged into the branch before editing or
alternatively
> is
> > there a way of informing users on different branches that the file
> has been
> > edited and they need to update their copy before proceeding.
>
In ClearCase, you could prevent a file from being branched. So
unmergeable files would only ever "exist" on the main branch aka, trunk.
Maybe make unmergeable files accessible only via an externals? It's
clumsy since externals can only be defined via a directory.
If SVN symlinks actually resolved to a file/dir (like they do in
ClearCase,) that would be an option also (make a symlink in each branch
to /trunk/.../word.doc, put svn:needs-lock on /trunk/.../word.doc)
*****
The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers. GA625
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: File lock issue
Posted by Andy Levy <an...@gmail.com>.
On Fri, May 2, 2008 at 4:00 AM, Srilakshmanan, Lakshman
<la...@police.vic.gov.au> wrote:
> I find that a file with svn:needs-lock creates an exclusive lock only in the
> branch I am working in.
Right, because once you make the branch, each copy is a separate
entity in the repository and they are not connected going forward.
> My understanding was that creating an exclusive lock was to ensure
> serialised update on files (eg word docs) because they cannot be merged.
That's one *use* of locks, but it's not a guarantee, as any user can
steal the lock unless you put in a pre-lock hook script to prevent it.
> Is there any way of preventing changes across branches till the latest copy
> of the file is merged into the branch before editing or alternatively is
> there a way of informing users on different branches that the file has been
> edited and they need to update their copy before proceeding.
Send out an email when the lock is created, perhaps? Manually lock each copy?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org