Svn: forget about deleted files

I did the following in a working copy of svn:

sheep@sheepbox# gvim Dual_On_Off_Model.h
sheep@sheepbox# gvim Dual_On_Off_Model.cpp
(... made the files, saved them ...)
sheep@sheepbox# svn add Dual_On_Off_Model.*
sheep@sheepbox# svn st
M    Multiple_On_Off_Model.h
A    Dual_On_Off_Model.h
A    Dual_On_Off_Model.cpp
sheep@sheepbox# rm Dual_On_Off_Model.*    <- Stupid on my part, but discovered
                                          <-  I didn't need the class

So later:

sheep@sheepbox# svn st
M    Multiple_On_Off_Model.h
!    Dual_On_Off_Model.h
!    Dual_On_Off_Model.cpp
sheep@sheepbox# svn commit
svn: Commit failed (details follow):
svn: '/home/sheep/src/secret_project_x/trunk/superduperd/Dual_On_Off_Model.h' is
scheduled for addition, but is missing

Basically, I deleted the files from my working copy without using svn rm, and now svn is crazy because it cannot find the files.

Since I do not need Dual_On_Off_Model. * and they have now switched to a large hard drive in the sky, is there a way I can use the Jedi mind trick on a working copy so that it does not yell at me?

+3
source share
4 answers

EDIT BETWEEN:

using:

svn revert -R .

it goes back to the svn revision, which you use as a local copy.

+5
source

Just re-add the files (or empty files with these names), then delete them using svn rm.

+6

svn revert * , * , , . svn revert Dual_On_Off_Model.h Dual_On_Off_Model.cpp.

To completely restore everything, you can use a little bash -fu:

svn status | awk '{print $2}' | xargs svn revert

Grab the second word from each line of output svn status(if you don't have spaces in the file names ...), then pass them as arguments svn revert.

+2
source

I was inspired by Josh Kelly's answer:

svn st | awk '$1 == "!" {print $2}' | xargs svn revert

should fix the whole tree that has this problem.

0
source

Source: https://habr.com/ru/post/1727713/


All Articles