So, i have a repository checked out on a folder (in a windows machine with tortoisesvn). Ive checked scripts on sites (even stackoverflow) but usually they come focusing on a windows command that sometimes doesn
t translate well going on windows.
I made a batch script that states:
svn cleanup
svn add --force Data\*
svn commit --username "user" --password "password" -m "Backup of the Day"
The idea is to run this script, every day, and commit the folder (AS IS) as a version. So it should delete anything that doesn`t exist, add anything that is new and update anything that was there and save as the "today's version".
I have already a delete problem on that script, as if something is deleted is not deleted by the script, but it keeps giving me erros from file locks (that shouldn't have) missing files scheduled to commit (that it should just ignore it).
Anyway, how can i make/change the script to allow me to make the repository version commit's to be exactly as is (remove/add/update ALL, any file, any folder, anything) the current checkout folder?
EDIT 2023-07-05 (add example as inguired by @Friedrich
This is the folder structure:
--C:\mysvn\run.bat (the batch command file)
--C:\mysvn\Data (the checkout folder for the repository)
Now, in the Data folder, let's say there are 2 files (file1.txt and file2.txt).
The idea is:
- If "file1.txt" or "file2.txt" was in the previous commit, update it if it had any changes.
- If "file1.txt" or "file2.txt" was not in the previous commit, add it.
- If there is any conflict of any kind, ignore it, commit "file1.txt" and "file2.txt" as is currenlty on "Data" folder.
Now on the next run, let's say someone deleted "file2.txt" from the "Data" folder.
- Delete "file2.txt" from the repository on next commit.
In a simple example as this one great, easy to humanly determine what happend and manually do what need to be done. But how can i accomplish it automatically witha script command? Since i don't know what files were added or removed from the folder, i run the "add --force Data*" to add any new file, but the remove command is more tricky, since the file is no longer on the folder, i don't know what files to pass to remove command.
I also run the "svn cleanup" command because sometimes there are file locks left behind, or for some reason something broke. And i also get some error messages (that i'd like to just order svn to ignore and run anyway, but i can't) when the "svn commit" command runs, saying that "Commit Failed: {file} was scheduled for addition, but is missing" (i did find this today, but i'm unsure if would work as i don't know this commands well).