[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: After removing and (re)adding file is deleted without warning
From: |
andyreifREMOVE_IT |
Subject: |
Re: After removing and (re)adding file is deleted without warning |
Date: |
Thu, 6 Nov 2003 18:30:02 +0100 |
User-agent: |
KMail/1.5.4 |
On Wednesday 05 November 2003 16:52, andyreifREMOVE_IT@studcs.uni-sb.de wrote:
> It's actually a feature request, since those who know this issue won't run
> into troubles.
>
> How to reproduce:
> Create file.txt with a text editor.
> cvs add file.txt
> cvs commit
> mv file.txt newfile.txt
> cvs remove -f file.txt
> Now you decide that the renaming is superfluous and want to undo the
> changes: rm newfile.txt
> Resave file.txt from the text editor.
> cvs add file.txt
> cvs add: file.txt should be removed and is still there (or is back again)
> -> (adding is not done ( this should be stated more clearly! ), and this
> might be forgotten by the user) Making _some changes_ to file.txt.
> cvs commit -m "" -> file will be removed and _some changes_ will be lost
> without warning, although from user's point of view this shouldn't be done.
>
> How to solve: check the date of last change for repository and local
> versions (like this is done for commit) and only if it "should't be
> committed" (i.e. there are no changes after the most recent update/commit)
> the file may be deleted without warnings. Otherwise (there are _some
> changes_): the user should be advised what to do, i.e. moving the modified
> files to a temporary directory and (re)adding them later, or perhaps this
> could be done by cvs some day?
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.
If the user had performed cvs remove and then has made some changes to a file,
he/she should be warned about this (perhaps with a possibility to abort, like
the one when you try to commit and have not typed anything into editor), and
if he/she still decides to proceed, this file should at least be backuped,
e.g. with the .# prefix (as this is done for files that are going to be
merged). In this case the changes would not be lost as it happens currently.
Any comments?