cvs, "file should be removed and is still there (or back again)" - version-control

I am trying to commit a project in which a file has been "cvs remove"d, but actually needs to be there. The contents has been completely rewritten, but it needs to retain the same name.
I am unable to either commit the project or re-add the file without getting this annoying error message. How do I "unremove" a file in CVS?

This worked for me:
Rename the file
mv mistakenly_removed_file wtf
Ask cvs to add the old version:
cvs add mistakenly_removed_file
cvs then reports it has resurrected the removed file.
mv wtf mistakenly_removed_file
cvs status reveals that the file is now "locally modified"

cvs add FILE
Or, alternatively, if you want to get the latest copy back from the repository
cvs update -C FILE

Related

In CVS how to ignore a file which is already checked in

In our CVS (not git!) repo I have a file which I checked in a while ago. Now we have decided not to keep it in version control.
How can I keep the file in my local directory but tell CVS not to store it? Just adding it to .cvsignore (obviously) doesn't do the trick.
As #tripleee mentioned in the comments, the following works:
Move the file in question out of the repository (but don't delete it).
Check in the removal of the file.
Commit the change to CVS.
Move the file back into its location the repo.
Add it to the appropriate .cvsignore file.
Done.

can't commit code after renaming a file

What I did:
renamed a file
tried to commit
cvs fails with error message
file should be removed and is still there (or back again)
What is the problem and how do I solve it so that I can commit?
Additional information:
I'm using Eclipse with the CVS plugin.
doing an ls in the directory where the file was shows that it is not there
All the other Google hits for this problem (including this question) seem to be asking what to do when a file has been removed with cvs, and then restored outside of cvs' scope. My problem is different: I just need to rename a file.
It means that the file was flagged for deletion by CVS but then appeared again. Renaming for CVS is just a deletion of the file with old name and adding the file with new name. The file must be appeared again with its old name.
You can do 2 things:
1) If you don't need this file then just delete it. (Use cvs -n update command to find its name.) Then you will be able to commit.
1) if you need this file to stay, go to the .CVS subfolder of the folder where the file is located and edit Entries file. Find a line with your file and delete it. Then rename you file (give it a temporary name), call cvs update, rename your file back overriding the new one appeared after cvs update.

Mercurial will not recognize new folder in repository

I have an existing repo which has been setup correctly and working fine. I deleted an entire project folder from the repo, committed the change, then added another version of the same folder which was not under VC. Now when I try to add or commit files in the new folder, Mercurial does not seem to recognize any of the new files.
Using the TortoiseHg Windows Explorer "commit" extension, when I try to the commit the folder(or any of the files within), no files show up in the dialogue. If I right click and commit a file within the folder, a pop up comes up that says "No files found for this operation". I am no Hg expert, although I have been using it for few months without a hitch, but I am pretty stuck on this one. Any ideas?
UPDATE: I have added a screenshot below showing what happens when I try to add the new folder. None of the files in the folder seem to be recognized.
The project I had copied had been a part of another repo, so it contained hg reference files. I deleted these, and everything added/committed perfectly.
If you want to commit a new file to a repository, you must first add it.
On the command line this can be done in various ways :
hg add which can add a file or a repository and every files it contains.
hg addremove which adds all new files and remove deleted ones.
hg commit -A or hg commit --addremove which are the same thing and a shortcut of hg add remove; hg commit.
I don't remember exactly where the command is in TortoiseHG, but I think if you right-click on the folder in the explorer, the option should be present.
I think I also remember an addremove option somewhere in the commit window, but I may be mistaken.
[UPDATE]
Based on the answer you provided yourself, here is the explanation of why simply adding the files weren't working :
Since the new directory contained repository related information (a .hg directory), Mercurial was treating it as a Subrepository. Subrepositories are repository contained in another, this can, for example, be used to reference a specific version of a library.
Once you delete the .hg directory in your new location, Mercurial didn's saw this as a Subrepo anymore and you were able to add the files normally.

Eclipse Git plugin - remove file from repo without deleting local

Using the Egit plugin, is it possible to permanently remove a file from source control without deleting the local copy?
I.e., is there a GUI action equivalent to running "git rm --cached"?
(Edited to simplify question)
I have found the answer. Team->Untrack is indeed the equivalent of "rm --cached". However there is a known bug which produces weird behaviour when you untrack and then try to commit.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=363405
Team -> Advanced -> Untrack
did the job (git rm --cached) for me.
I had the same problem, after not initially including directories and files in .ignore. I also tried "Untrack" and "Remove from index" possibility, non of which helped(due to the still unresolved Egit issue).
So, in the end I deleted files locally (leaving the project all in bugs), committed and pushed it to the github, and then undid the delete locally and added files to .ignore.
Very unelegant, but it worked.
I lost a lot of time and nerves on it, and I hope this helps someone.
Another option, similar to what Sri Sankaran suggests in the comments, is to update the index in order to assume no modification to your config file:
On the preferences, in Egit, you can list "assumed unchanged" files
:
The file remains versioned and on the disk, but no modification will be detected on it.
If you need to delete invisible folder(or file) from eclipse project:
Add folder(or file) to .gitignore file;
Replace folder to another directory
Team add to index, commit and push
Replace folder(or file) to the project folder

svn rollback Settings.bundle

I am trying to rollback to a previous version of the file/folder Settings.bundle. A file was added to Settings.bundle/en.lproj. If I just delete it I just keep getting missing file warnings (and I don't want to). So now I am trying to rollback, but it seems to do nothing when I try to run the command:
svn merge -r 15:5 ./Settings.bundle/
Any thoughts?
Should work so far according to Undoing Changes in svn red book. Maybe it's worth trying to run svn delete on those files added since revision 5 (sounds like you don't need them any longer), commit it and perform svn merge again.
Alternatively you can do it manually by running svn export of the Settings.bundle to a temp directory. Afterwards svn delete on all files added since revision 5 and copy files from temp dir back to your working directory. Now you are ready to commit revision 16.