PageRenderTime 37ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 0ms

/Mercurial.Net/Hooks/MercurialPreTransactionCommitHook.cs

#
C# | 66 lines | 30 code | 5 blank | 31 comment | 0 complexity | ddf210b07bd0890c77c706e17d72381b MD5 | raw file
Possible License(s): BSD-3-Clause, GPL-2.0
  1. namespace Mercurial.Hooks
  2. {
  3. /// <summary>
  4. /// This <see cref="MercurialControllingHookBase"/> descendant implements the
  5. /// code necessary to handle the "pretxncommit" hook:
  6. /// This is run after a changeset has been created but the transaction not yet committed.
  7. /// </summary>
  8. /// <remarks>
  9. /// As with all controlling hooks (descendants of <see cref="MercurialControllingHookBase"/>), you can
  10. /// prevent the command from continuing, or let it continue, by calling
  11. /// <see cref="MercurialControllingHookBase.TerminateHookAndCancelCommand(int)"/>
  12. /// or <see cref="MercurialControllingHookBase.TerminateHookAndProceed"/> respectively.
  13. /// </remarks>
  14. public class MercurialPreTransactionCommitHook : MercurialControllingHookBase
  15. {
  16. /// <summary>
  17. /// This is the backing field for the <see cref="CommittedRevision"/> property.
  18. /// </summary>
  19. private readonly RevSpec _CommittedRevision = LoadRevision("HG_NODE");
  20. /// <summary>
  21. /// This is the backing field for the <see cref="LeftParentRevision"/> property.
  22. /// </summary>
  23. private readonly RevSpec _LeftParentRevision = LoadRevision("HG_PARENT1");
  24. /// <summary>
  25. /// This is the backing field for the <see cref="RightParentRevision"/> property.
  26. /// </summary>
  27. private readonly RevSpec _RightParentRevision = LoadRevision("HG_PARENT2");
  28. /// <summary>
  29. /// Gets the <see cref="RevSpec"/> identifying the revision that was committed.
  30. /// </summary>
  31. public RevSpec CommittedRevision
  32. {
  33. get
  34. {
  35. return _CommittedRevision;
  36. }
  37. }
  38. /// <summary>
  39. /// Gets the <see cref="RevSpec"/> identifying the left parent of the changeset
  40. /// that was committed.
  41. /// </summary>
  42. public RevSpec LeftParentRevision
  43. {
  44. get
  45. {
  46. return _LeftParentRevision;
  47. }
  48. }
  49. /// <summary>
  50. /// Gets the <see cref="RevSpec"/> identifying the left parent of the changeset
  51. /// that was committed; or <c>null</c> if this is not a merge changeset.
  52. /// </summary>
  53. public RevSpec RightParentRevision
  54. {
  55. get
  56. {
  57. return _RightParentRevision;
  58. }
  59. }
  60. }
  61. }