bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: After removing and (re)adding file is deleted without warning


From: Jim.Hyslop
Subject: RE: After removing and (re)adding file is deleted without warning
Date: Thu, 6 Nov 2003 13:26:21 -0500

andyreifREMOVE_IT@studcs.uni-sb.de wrote:
[remove followed by an add]
> IMHO it would be better to ignore the cvs remove command if 
> it is followed by 
> an add command on the same file.
> I do not think this would cause problems, since it is only a 
> local copy issue, 
> and it is something that user supposes to happen.
Possibly, yes. But it's also possible that the user didn't intend to re-add
file.txt, but meant to add something else.

Instead, how about adding a flag to the add command, to indicate that the
user intends to "undo the remove". That would simplify processing (CVS
wouldn't have to check timestamps), and allow both user scenarios without
having to guess the user's intent.

The error message you posted earlier:
> cvs add: file.txt should be removed and is still there (or is back again)
would become something like:

cvs add: file.txt has been scheduled for removal. Use the -r flag if you
intend to cancel the removal.

So, for scenario 1 (the one you originally posted, in which the user meant
to re-add the file) the sequence would be:
$ mv file.txt newfile.txt
$ cvs remove -f file.txt
$ mv newfile.txt file.txt
$ cvs add file.txt
cvs add: file.txt has been scheduled for removal. Use the -r flag if you
intend to cancel the removal.
$ cvs add -r file.txt

and for scenario 2 (the one I mentioned above):
$ cvs remove -f build.log
$ cvs add build.log
cvs add: build.log has been scheduled for removal. Use the -r flag if you
intend to cancel the removal.
(at this point the user says "Doh!")
$ cvs add build.txt
$ cvs ci -m"Instructions on how to build this thing" build.txt

Thoughts?

-- 
Jim Hyslop
Senior Software Designer
Leitch Technology International Inc. (http://www.leitch.com)
Columnist, C/C++ Users Journal (http://www.cuj.com/experts)

Let's build software that works the way people expect.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]