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

Re: Locking: RFC: svn:needs-lock behaviors (Updated)

From: Brian W. Fitzpatrick <fitz_at_collab.net>
Date: 2005-02-03 20:21:51 CET

On Feb 2, 2005, at 4:49 PM, Philip Martin wrote:

> "Brian W. Fitzpatrick" <fitz@collab.net> writes:
>
>> svn:needs-lock behaviors:
>> =========================
>>
>> Checkout:
>> - If svn:needs-lock is set on a file when the file is checked out, set
>> the file to read-only.
>
> 'svn update' doesn't currently work on Windows if the working files
> are read-only, you will need to add some permission changing code.

OK. I'll have to add code to accomodate that (I would assume that
there's already code somewhere to do this).

>> - If svn:needs-lock is unset in wc, but update sets it: Set file to
>> read-only.
>
> 1. Even if the file has local mods? I wonder if 'svn revert' works on
> Windows if the working file is read-only.

If the file has local mods, we should either do nothing or error out.
What do you think?

> 2. What about:
>
> svn lock foo
> svn ps svn:needs-lock '*' foo
> svn ci --no-unlock foo
> svn up -rCOMMITTED-1 foo
> svn up -rHEAD foo
>
> Is the -rCOMMITTED-1 update allowed?

Yes. That would effectively remove svn:needs-lock and flip the file
back to read-write.

> If so, then the -rHEAD update
> causes svn:needs-lock to become set while the working copy already
> holds a lock.

Do you think that that's a problem?

>> - If svn:needs-lock is set in wc, but update unsets it: Set file to
>> read-write.
>> - If svn:needs-lock is set or unset in both places: Do nothing.
>
> - If svn:needs-lock is set in both places and the update breaks a
> lock: Make the file read-only. Even if locally modified?
>
>> Propset:
>> - Setting the svn:needs-lock property sets the file to read-only
>> (It also canonicalizes the value to '*')
>
> 1. Not if the file is locked in the current wc.

Right.

> 2. What about schedule add files? I don't think they can be locked so
> they should remain read-write.

I agree. This will be one of the cases where the file will be set to
read-only only on commit.

>> Propdel:
>> - Removing svn:needs-lock sets the file to read-write.
>>
>> Propedit:
>> - If the property is changed via propedit, we need to canonicalize it
>> to '*'.
>>
>> Lock:
>> - If svn:needs-lock is set, the file is set to read-write.
>>
>> Unlock:
>> - If svn:needs-lock is set, the file is set to read-only.
>
> repos-to-wc or wc-to-wc copy:
> - Ensure that the copy is read-write even if svn:needs-lock is set
> as this is another schedule add case.

And then flip to read-only on commit, right?

-Fitz

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Feb 3 20:24:11 2005

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

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