[cvsnt] Feature request unreserved edit

Oliver Giesen ogware at gmx.net
Tue Nov 18 11:20:28 GMT 2003


irodriguez perez wrote:

> With cvsnt we can do a reserved edit (cvs edit -c). So if we use it
> we have the next scenario:
> 
> 1.-cvs edit -c file1.txt. (Only edit file1.txt if anyone has editted
> it too)

That was probably a typo? You could only edit -c a file if *noone* else
is editing it.


> 2.-modify file1.txt.
> 3.-cvs commit -c file1.txt.
> 
> And file1.txt is automatically uneditted (and read-only).
> 
> If we do a cvs edit without -c option.
> 
> 1.-cvs edit file1.txt. (Edit file1.txt althought another user has
> done a reserved edit).
> 2.-modify file1.txt.
> 3.-cvs commit -c file1.txt.
> 
> And file1.txt can't be uneditted (the file is writeable), but if we
> change it and try a commit -c the command fails (that's ok) saying
> that the user is not a valid editor. The only way to do it
> unwriteable with cvs unedit command is to do a cvs edit again and a
> then do a cvs unedit.

If that's what's happening for you it is either a bug or you haven't
checked out the file read-only in the first place. After the commit the
file should be read-only and unedited (i.e. you no longer get reported
by cvs editors) again.


> Well, if i want edit a file, i can do cvs edit and cvs edit -c, but,
> what happens if i want edit a file with 2 conditions?:
> 
> 1.-I don't want edit file1.txt if another user has done a reserved
> edit on it. 
> 2.-I want allow to other users edit the file at the same
> time i am editing it, i don't want to do a reserved edit, i want to
> do an unreserved edit.
> 
> I can't do cvs edit because condition 1 fails.
> I can't do cvs edit -c because condition 2 fails.
> 
> Is there some way to do it? If there is another way please say me,
> but i haven't could find it.
> 
> I propose a new edit option. For example -u. With this option if
> another user has editted the file with a reserved edit i couldn't
> edit it. But if anyone has done a reserved edit on the file i can
> edit it. If another user use edit -u, after i used it, he can edit
> the file.

AFAIK CVS(NT) does currently keep no record of how a file was edited
(reserved or not) so taking the edit mode into account would probably
require quite fundamental changes...

 
> Of course, reserved edit should change, if a user wants to do a
> reserved edit on a file, but the file has been editted with -u option
> the command shall fail.

Reserved edit will already fail if the file is edited in /any/ way. As
I said, to my knowledge, CVS(NT) has no idea in what mode a file is
being edited. It only knows /that/ it is edited. The -c stands for
"_c_heck editors" - nothing more really. In the case of edit -c it
checks whether there are /any/ editors and if so aborts. In the case of
commit -c it checks if /I/ am one of the listed editors and aborts
otherwise.


> A normal scenario for this is:
> 
> 1.-cvs edit -u file1.txt. (Only edit file1.txt if anyone has done a
> reserved edit on file1.txt

Again, you probably meant *noone* instead of /anyone/, didn't you?


> Well, i don't know if somebody can find it useful, but i think it can
> do the reserved and unreserved checkouts in cvsnt clearer than now.

I don't think so. It's already rather confusing with the two existing
modes IMO. I don't think it will get any better by introducing a third
one and furthermore complicate the inner logic of the other two even
more.

Cheers, 

-- 
Oliver
----  ------------------
JID:  ogiesen at jabber.org
ICQ:  18777742     (http://wwp.icq.com/18777742)


More information about the cvsnt mailing list