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

RE: File lock issue

From: Harvey, Edward <Edward.Harvey_at_patni.com>
Date: Fri, 2 May 2008 08:02:28 -0400

> 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_at_patni.com and delete this mail.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-05-02 14:03:01 CEST

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

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