AnkhSVN Client Side Pre-Capture Capture

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

Everyone seems to be thinking about server-side hooks (with all their evil potential).

I want the client side of the script to run before commit, so astil can format the code the way I like his boss.

Since my IDE (VS2010Pro) automatically checks when a file has been modified on disk, I select it to reboot, there is no real evil with all this.

Is there any (clean) way to accomplish this using AnkhSVN?

Perhaps there is also a way to extend VisualStudio to call my pre-commit-script ...

+3
source share
3 answers

It seems that AnkhSVN is used to use the TortoiseSVN hook scripts, as there is a conversation that it is in nightly builds . In addition, daily updates seem to mention hooks (e.g., version 10870 and version 10873 .

Try to get a daily build and view the subversion options in Tools->Options->Source Control->Subversion Environment in Visual Studio. If this does not work, try opening the Windows registry at HKEY_CURRENT_USER\Software\Ankh​SVN\VisualStudio\​<Version>\Conf​iguration (where <Version> should be 10.0 for you) and add a line called EnableTortoiseSvnHooks with the data True , like indicated in the link above.

+3
source

Visual Studio> Tools> Options

enter image description here

+1
source

If you can move away from AnkhSVN and switch to TortoiseSVN , you will get client-side hook support for free .

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

The pre-commit hook, for example, receives the following parameters:

 PATH DEPTH MESSAGEFILE CWD 

If the items are as follows:

  • PATH
    The path to a temporary file that contains all the paths for which the operation was run. Each path is on a separate line in the temporary file.

  • DEPTH
    Depth at which commit / update is performed.

  • MESSAGEFILE
    The path to the file containing the log message to commit. The file contains UTF-8 encoded text. After the start-commit hook completes successfully, the log message is read back, giving the hook the ability to modify it.

  • CWD
    The current working directory with which the script is running. This is installed in the shared root directory of all affected paths.

While TortoiseSVN is not integrated into VS, I think it would be nice to look, as you could use it as a universal client for other projects (i.e. all your other coding / scripting materials that you don't do with V.S.).

0
source

Source: https://habr.com/ru/post/1300839/


All Articles