AnkhSVN client side pre-commit hook

点点圈 提交于 2019-11-29 11:48:59

It seems like AnkhSVN is being made to use TortoiseSVN's hook scripts, as there is a conversation about it being in the nightly builds. Also the daily updates seem to mention hooks (e.g revision 10870 and revision 10873.

Try getting a daily build and seeing the subversion options in Tools->Options->Source Control->Subversion Environment in Visual Studio. If that doesn't work try opening Windows registry to HKEY_CURRENT_USER\Software\Ankh​SVN\VisualStudio\​<Version>\Conf​iguration (where <Version> should be 10.0 for you) and adding a string named EnableTortoiseSvnHooks with the data True, as mentioned in the above conversation link.

Visual Studio > Tools > Options

If you could move away from AnkhSVN and switch over to TortoiseSVN, you'll get support for client side hooks for free.

You could use any executable thing as a hook and they get passed different parameters depending on the type of the hook scripts.

The pre-commit hook for example gets the following parameters:

PATH DEPTH MESSAGEFILE CWD

Where the elements are the following:

  • PATH
    A path to a temporary file which contains all the paths for which the operation was started. Each path is on a separate line in the temp file.

  • DEPTH
    The depth with which the commit/update is done.

  • MESSAGEFILE
    Path to a file containing the log message for the commit. The file contains the text in UTF-8 encoding. After successful execution of the start-commit hook, the log message is read back, giving the hook a chance to modify it.

  • CWD
    The current working directory with which the script is run. This is set to the common root directory of all affected paths.

While TortoiseSVN is not integrated into VS, I think it would be worth a look since you could use it as a general-purpose client for other projects too (i.e. all your other coding/scripting stuff that you don't do with VS).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!