tags:

views:

47

answers:

3

Hello!

Вeing a happy user of git I now have to switch back to svn in one of the projects. I use it through the shell in Ubuntu and look for some command which may be similar to "git add ." - looking for all the files and folders being added, deleted or moved and making appropriate changes in the repository.

Does it exist? It seems so strange to me that you have to tell it svn explicitly every time you want to delete or move something..

Your tips will save my time, thanks! :)

+1  A: 

i don't know if this is what you are looking for, but

svn add * --force 

will add all files in subdirectories.

Orbit
Will it delete from the repository those files which were deleted in file system? Is it the same as svn add * ?
lyuba
sorry, typo. i don't think it will delete, no.
Orbit
A: 

Actually, you do have to tell svn every time you delete a file. The command is svn delete. Sorry. :(

Best thing I can suggest would be a bash for loop to get it done:

for file in {mydelfile.c,myseconddelfil.c,etc}; do svn delete "$file"; done

Saves on typing. If you've already removed the files from your system and done and svn ci, then you can programmatically determine which ones you deleted by doing:

svn up | grep '^Restored' | awk '{print $2}' | sed s/\'//g

So putting it all together.

for file in $(svn up | grep '^Restored' | awk '{print $2}' | sed s/\'//g); do svn delete "$file"; done

Tested as working in zsh, your shell and mileage may vary.

OmnipotentEntity
A: 

You might be able to make use of incron or inotifywait to take action upon changes in selected portions of your filesystem.

Dennis Williamson