You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by "Brian W. Fitzpatrick" <fi...@collab.net> on 2005/02/03 20:01:01 UTC

Locking: RFC: svn:needs-lock behaviors Part Deux

Based on everyone's feedback, here's my revised doc.  There are a few 
questions under Update.


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.

Update:

- If svn:needs-lock is unset in wc, but update sets it:
   - If the file has local mods, print a warning and do nothing???
   - Else, set file to read-only.
- 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 and the lock is removed by update (i.e.,
   the lock in the wc was defunct):
   - If the file has local mods, print a warning and do nothing???
   - Else, set the file to read-only.

Propset:
- Setting the svn:needs-lock property does the following:

   - If the file is not locked, it sets the file to read-only.
   - If the file is locked, it does nothing.
   - If file has local mods, it does nothing (see Commit, below)
   - If the file is scheduled to be added, it does nothing (see Commit, 
below)

   (Propset also canonicalizes the value to '*')

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.

Copy:

- 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.

Commit:
- If a file has the svn:needs-lock property set:
   - If file had local mods, set the file to read-only.
   - If file is being added, set the file to read-only.



Caveats:

- 'svn update' doesn't currently work on Windows if the working files
   are read-only, you will need to add some permission changing code.


-Fitz


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

Re: Locking: RFC: svn:needs-lock behaviors Part Deux

Posted by "Brian W. Fitzpatrick" <fi...@collab.net>.
On Feb 3, 2005, at 2:30 PM, Peter N. Lundblad wrote:

> On Thu, 3 Feb 2005, Brian W. Fitzpatrick wrote:
>
>> svn:needs-lock behaviors:
>> =========================
>>
>> Update:
>>
>> Propset:
>> - Setting the svn:needs-lock property does the following:
>>
>>    - If the file is not locked, it sets the file to read-only.
>>    - If the file is locked, it does nothing.
>>    - If file has local mods, it does nothing (see Commit, below)
>>    - If the file is scheduled to be added, it does nothing (see 
>> Commit,
>> below)
>>
> I like ghudson's suggestion to make the read-only state depend on the
> propsbase value of svn:needs-lock. This would mean that propset won't
> touch the read-only state. My reasoning is that we don't need to 
> protect
> the users from themselves in this case, we want to protect users from
> stepping on other users feet. So, svn:needs-lock only really takes 
> effect
> on commit.

Ah, OK.  So any propset of svn:needs-lock will flip perms at commit 
time, right?

> BTW, have we specified if properties are made read-only if 
> svn:needs-lock
> is set, disallowing pset and pedit if needs-lock is set and the file is
> not locked?

Interesting idea, but it doesn't have a workaround like the file perms 
do (any knowledgeable user can flip the write bit on a file manually).  
Still, I like that idea.  What do the rest of you think?

>> Commit:
>> - If a file has the svn:needs-lock property set:
>>    - If file had local mods, set the file to read-only.
>
> ONly if file is unlocked, ofcourse.

Noted.

Thanks,

-Fitz


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

Re: Locking: RFC: svn:needs-lock behaviors Part Deux

Posted by "Peter N. Lundblad" <pe...@famlundblad.se>.
On Thu, 3 Feb 2005, Brian W. Fitzpatrick wrote:

> svn:needs-lock behaviors:
> =========================
>
> Update:
>
> Propset:
> - Setting the svn:needs-lock property does the following:
>
>    - If the file is not locked, it sets the file to read-only.
>    - If the file is locked, it does nothing.
>    - If file has local mods, it does nothing (see Commit, below)
>    - If the file is scheduled to be added, it does nothing (see Commit,
> below)
>
I like ghudson's suggestion to make the read-only state depend on the
propsbase value of svn:needs-lock. This would mean that propset won't
touch the read-only state. My reasoning is that we don't need to protect
the users from themselves in this case, we want to protect users from
stepping on other users feet. So, svn:needs-lock only really takes effect
on commit.

BTW, have we specified if properties are made read-only if svn:needs-lock
is set, disallowing pset and pedit if needs-lock is set and the file is
not locked?

> Commit:
> - If a file has the svn:needs-lock property set:
>    - If file had local mods, set the file to read-only.

ONly if file is unlocked, ofcourse.

//Peter

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