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

Re: svn commit: r14842 - trunk/subversion/clients/cmdline

From: Brian W. Fitzpatrick <fitz_at_red-bean.com>
Date: 2005-05-27 18:07:21 CEST

On May 27, 2005, at 10:51 AM, Philip Martin wrote:

> "Brian W. Fitzpatrick" <fitz@collab.net> writes:
>
>
>> On May 26, 2005, at 3:52 PM, Philip Martin wrote:
>>
>>
>>> Also I'm not really clear what constitutes a "non-fatal locking
>>> error":
>>>
>>> $ svn lock wc/a wc/x
>>> svn: warning: Path '/a' is already locked by user 'pm' in
>>> filesystem '/home/pm/sw/subversion/obj/repo/db'
>>> ../svn/subversion/libsvn_fs_fs/err.c:286: (apr_err=160017)
>>> svn: '/x' is not a file in filesystem '/home/pm/sw/subversion/obj/
>>> repo/db'
>>>
>>> One of those comes out as a warning and the other as an error, but I
>>> see no reason why they should be different. I can't ensure that
>>> wc/x
>>> is a file before making the call any more than I can ensure that
>>> wc/a
>>> is unlocked.
>>>
>>
>> Sure, but you're attempting to lock a file here, not to 'svn add' a
>> file and then lock it. Finding an existing lock ("This file is
>> already locked") is quite different than attempting to lock a non-
>> existent or non-versioned file ("Lock wc/x? I see no wc/x here.").
>>
>
> I don't really understand why they are "quite different".
>
> Both wc/a and wc/x are files in my working copy, neither is locked.
> If I do a check (status or ls) before issuing the lock command I see
> two unlocked files. There's a window between my check and lock
> command during which somebody locks one file and replaces the other
> with a directory, so both lock attempts fail.

> It's not clear to me why we have chosen to make one of those
> "non-fatal". The best I can come up with is that "already locked"
> occurs more often. Is that really it? If an error occurs frequently
> we make it non-fatal?

I think it's all about intent. Given 'wc/a' and 'wc/b', if you
already have a lock on wc/a and then run 'svn lock wc/a wc/b', you've
already got a lock on wc/a, so why error? We just inform you that
you already had a lock, then move on to wc/b. It's the same thing
with attempting to 'svn add' a file that's already been added:

$ touch 1 2 3
$ svn add 2
A 2
$ svn add ?
A 1
svn: warning: '2' is already under version control
A 3

In your case, however, wc/x has been replaced with a directory and I
consider that to be a different case--you can't just lock the
directory, and you don't already have a lock on it.

Does that make sense? Am I misunderstanding what you're saying?

-Fitz

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri May 27 18:08:09 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.