De IBugtraqProvider2 interface

In TortoiseSVN 1.6 is een nieuwe interface toegevoegd, welke het gebruik van plugins mogelijk maakt. Deze IBugtraqProvider2 interface erft functionaliteit van IBugtraqProvider.

HRESULT GetCommitMessage2 (
  // Hoofd scherm voor je provider UI.
  [in] HWND hParentWnd,

  // Parameters voor jouw provider.
  [in] BSTR parameters,
  // De gemeenschappelijke URL van de vastlegging
  [in] BSTR commonURL,
  [in] BSTR commonRoot,
  [in] SAFEARRAY(BSTR) pathList,

  // De tekst die al aanwezig is in het vastleg bericht.
  // Je provider moet deze tekst opnemen in het nieuwe bericht,
  // indien gewenst.
  [in] BSTR originalMessage,

  // Je kunt eigen revisie eigenschappen toekennen aan een vastlegging
  // door de volgende twee parameters in te stellen.
  // noot: Beide Both safearrays moeten dezelfde lengte hebben.
  //       Elke eigenschas naam moet er een waarde hebben!

  // De inhoud van het bugID veld(indien weergegeven)
  [in] BSTR bugID,

  // Gewijzigde inhoud van het bugID veld
  [out] BSTR * bugIDOut,

  // De lijst van revision eigenschapsnamen.
  [out] SAFEARRAY(BSTR) * revPropNames,

  // De lijst van revisie eigenschap waardes.
  [out] SAFEARRAY(BSTR) * revPropValues,

  // De nieuwe tekst van het vastleg bericht.
  // Deze vervangt het originele bericht
  [out, retval] BSTR * newMessage
);

This method is called from the TortoiseSVN commit dialog when the user clicks on the plugin button. This method is called instead of GetCommitMessage(). Please refer to the documentation for GetCommitMessage for the parameters that are also used there.

The parameter commonURL is the parent URL of all items selected to bring up the commit dialog. This is basically the URL of the commonRoot path.

The parameter bugID contains the content of the bug-ID field (if it is shown, configured with the property bugtraq:message).

The return parameter bugIDOut is used to fill the bug-ID field when the method returns.

The revPropNames and revPropValues return parameters can contain name/value pairs for revision properties that the commit should set. A plugin must make sure that both arrays have the same size on return! Each property name in revPropNames must also have a corresponding value in revPropValues. If no revision properties are to be set, the plugin must return empty arrays.

HRESULT CheckCommit (
  [in] HWND hParentWnd,
  [in] BSTR parameters,
  [in] BSTR commonURL,
  [in] BSTR commonRoot,
  [in] SAFEARRAY(BSTR) pathList,
  [in] BSTR commitMessage,
  [out, retval] BSTR * errorMessage
);

This method is called right before the commit dialog is closed and the commit begins. A plugin can use this method to validate the selected files/folders for the commit and/or the commit message entered by the user. The parameters are the same as for GetCommitMessage2(), with the difference that commonURL is now the common URL of all checked items, and commonRoot the root path of all checked items.

For the branch/tag dialog, the commonURL is the source URL of the copy, and commonRoot is set to the target URL of the copy.

The return parameter errorMessage must either contain an error message which TortoiseSVN shows to the user or be empty for the commit to start. If an error message is returned, TortoiseSVN shows the error string in a dialog and keeps the commit dialog open so the user can correct whatever is wrong. A plugin should therefore return an error string which informs the user what is wrong and how to correct it.

HRESULT  OnCommitFinished (
  // Hoofdscherm voor elk (foutmelding) UI welke getoond moet worden.
  [in] HWND hParentWnd,

  // De gemeenschappelijke bron voor alle paden die vastgelegd worden.
  [in] BSTR commonRoot,

  // Alle paden die vastgelegd zijn.
  [in] SAFEARRAY(BSTR) pathList,


  // De reeds aanwezige tekst in het vastleg bericht.
  [in] BSTR logMessage,

  // De revisie van de vastlegging.
  [in] ULONG revision,


  // Een fout getoond aan de gebruiker als deze functie
  // iets anders teruggeeft dan S_OK
  [out, retval] BSTR * error
);

This method is called after a successful commit. A plugin can use this method to e.g., close the selected issue or add information about the commit to the issue. The parameters are the same as for GetCommitMessage2.

HRESULT HasOptions(
  // Of de provider opties ondersteund
  [out, retval] VARIANT_BOOL *ret
);

This method is called from the settings dialog where the user can configure the plugins. If a plugin provides its own configuration dialog with ShowOptionsDialog, it must return TRUE here, otherwise it must return FALSE.

HRESULT ShowOptionsDialog(
  // Parent window for the options dialog
  [in] HWND hParentWnd,

  // Parameters voor je provider.
  [in] BSTR parameters,

  // De parameter tekst
  [out, retval] BSTR * newparameters
);

This method is called from the settings dialog when the user clicks on the "Options" button that is shown if HasOptions returns TRUE. A plugin can show an options dialog to make it easier for the user to configure the plugin.

The parameters string contains the plugin parameters string that is already set/entered.

The newparameters return parameter must contain the parameters string which the plugin constructed from the info it gathered in its options dialog. That paramameters string is passed to all other IBugtraqProvider and IBugtraqProvider2 methods.