views:

184

answers:

1

Is there a way I can set up a client-side script/hook/setting/whatever to have a default message in the TortoiseSVN Commit dialog?

(I want to put some text there to remind me to note bug number when I check in code.)

+6  A: 

You can set the bugtraq:url and bugtraq:warnifnoissue properties on your repository, so that a gentle warning is shown when no bug number provided.

http://tortoisesvn.net/docs/release/TortoiseSVN%5Fen/tsvn-dug-bugtracker.html


Edit

Ok... here's another way. You can create a Start-commit hook within TSVN:

Save this as a .vbs file locally:

'Get the arguments - (     PATH  MESSAGEFILE  CWD  )
'http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-settings.html#tsvn-dug-settings-hooks
Set ArgObj = WScript.Arguments
dim file
file = ArgObj(1)
'OPen the log message
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(file, 2, 1)
'Write in the warning
objFile.Write("Don't forget to add a bug case!!!")
objFile.Close

Add the hook using TSVN -> Settings -> Hook Scripts -> Add Set the working copy path to the path you wish it to apply for (or e.g. c:\ if you want it to apply for everything on your c drive) Set the command line to execute to:

wscript c:\[Path to script]\message.vbs

Tick the two check boxes.

Now when you click commit, the vbs will get passed the location of the temporary message file, it appends your message and then gets displayed in the commit dialog.

djch
Alas, if I were in a position to alter properties of the repository, I wouldn't even ask this question; I'd just set a hook to allow changing check-in messages, and then I could fix it when I forget. Unfortunately, my boss is paranoid about changing *anything* server-side about TortoiseSVN, so I need to find a client-side solution.
Kyralessa
That .vbs script works perfectly on the client-side, and is *exactly* what I was looking for! Thanks!
Kyralessa