PageRenderTime 63ms CodeModel.GetById 20ms RepoModel.GetById 3ms app.codeStats 0ms

/Mercurial.Net/Hooks/IMercurialControllingHook.cs

#
C# | 50 lines | 11 code | 4 blank | 35 comment | 0 complexity | d76917fb0c90e35acec10e44ec18bb87 MD5 | raw file
Possible License(s): BSD-3-Clause, GPL-2.0
  1. using System;
  2. namespace Mercurial.Hooks
  3. {
  4. /// <summary>
  5. /// This interface must be implementing by all controlling hooks.
  6. /// </summary>
  7. public interface IMercurialControllingHook
  8. {
  9. /// <summary>
  10. /// Terminates the hook program and allows the Mercurial command being hooked to proceed as normal.
  11. /// </summary>
  12. void TerminateHookAndProceed();
  13. /// <summary>
  14. /// Terminates the hook and cancels the Mercurial command being executed.
  15. /// </summary>
  16. /// <param name="exitCode">
  17. /// The exit code to pass back to Mercurial, must be or higher to signal failure. Default is 1.
  18. /// </param>
  19. /// <param name="message">
  20. /// A message to output to the Mercurial console log; or an empty string if no such message is needed.
  21. /// </param>
  22. /// <exception cref="ArgumentOutOfRangeException">
  23. /// <para><paramref name="exitCode"/> must be 1 or higher.</para>
  24. /// </exception>
  25. /// <exception cref="ArgumentNullException">
  26. /// <para><paramref name="message"/> is <c>null</c>.</para>
  27. /// </exception>
  28. void TerminateHookAndCancelCommand(int exitCode, string message);
  29. /// <summary>
  30. /// Terminates the hook and cancels the Mercurial command being executed, with
  31. /// an exit code of 1 and no message.
  32. /// </summary>
  33. void TerminateHookAndCancelCommand();
  34. /// <summary>
  35. /// Terminates the hook and cancels the Mercurial command being executed, with
  36. /// the specified exit code and no message.
  37. /// </summary>
  38. /// <param name="exitCode">
  39. /// The exit code to pass back to Mercurial, must be or higher to signal failure. Default is 1.
  40. /// </param>
  41. /// <exception cref="ArgumentOutOfRangeException">
  42. /// <para><paramref name="exitCode"/> must be 1 or higher.</para>
  43. /// </exception>
  44. void TerminateHookAndCancelCommand(int exitCode);
  45. }
  46. }