AnkhSVN client side pre-commit hook

后端 未结 3 939
时光说笑
时光说笑 2020-12-19 20:28

Basically I want to do the same thing as the fella over there.

It seems that everybody was thinking about server-side hooks (with all their evil potential).

相关标签:
3条回答
  • 2020-12-19 20:40

    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.

    0 讨论(0)
  • 2020-12-19 20:57

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

    0 讨论(0)
  • 2020-12-19 20:59

    Visual Studio > Tools > Options

    enter image description here

    0 讨论(0)
提交回复
热议问题