Tortoise SVN auto-commit from CMD

Viewed 24

I am relatively new to Tortoise SVN and wanted to find a way to auto-commit and update files. I can complete the task manually with the CMD prompt but wanted to know if there was a way to run this through task scheduler.

I previously would have used a .bat file but my workplace has banned this (for whatever reason). I can however tell the task scheduler a particular line of code. The following works to manually update within CMD Prompt. Any suggestions would be appreciated.

''' CD C:\location\of\files

svn commit -m 'updated data for processing run'

svn update '''

1 Answers

I have answered my own question sorry. In python I have defined a function which commits the file in a particular directory which I can call directly from CMD.

I wrote it this way in prep for cleanup and other SVN works.

import subprocess
from datetime import datetime as dt

def commentCreator(processString):
    currentTime = dt.strftime(dt.now(),'%Y-%m-%d:%H:%M:%S')
    comment = f'Successfully completed SVN {processString} @ {currentTime}'
    
    return comment
                              
def commitFolderToSVN(folderLocation):
    comment = commentCreator('Commit')
    subprocess.call(["svn", "commit", folderLocation,f'-m {comment}'], shell=True)
    
    
Related