简体   繁体   中英

Subversion (TortoiseSVN) - Default check in message?

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.)

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_en/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 eg 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM