PageRenderTime 40ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/Mercurial.Net/Hooks/MercurialCommitHook.cs

#
C# | 62 lines | 31 code | 6 blank | 25 comment | 0 complexity | 984ef9d47dbce2b3453068acc9bc68bf MD5 | raw file
Possible License(s): BSD-3-Clause, GPL-2.0
  1. using System;
  2. namespace Mercurial.Hooks
  3. {
  4. /// <summary>
  5. /// This <see cref="MercurialHookBase"/> descendant implements the
  6. /// code necessary to handle the "commit" hook:
  7. /// This is run after a new changeset has been created in the local repository.
  8. /// </summary>
  9. public class MercurialCommitHook : MercurialHookBase
  10. {
  11. /// <summary>
  12. /// This is the backing field for the <see cref="CommittedRevision"/> property.
  13. /// </summary>
  14. private readonly RevSpec _CommittedRevision = LoadRevision("HG_NODE");
  15. /// <summary>
  16. /// This is the backing field for the <see cref="LeftParentRevision"/> property.
  17. /// </summary>
  18. private readonly RevSpec _LeftParentRevision = LoadRevision("HG_PARENT1");
  19. /// <summary>
  20. /// This is the backing field for the <see cref="RightParentRevision"/> property.
  21. /// </summary>
  22. private readonly RevSpec _RightParentRevision = LoadRevision("HG_PARENT2");
  23. /// <summary>
  24. /// Gets the <see cref="RevSpec"/> identifying the revision that was committed.
  25. /// </summary>
  26. public RevSpec CommittedRevision
  27. {
  28. get
  29. {
  30. return _CommittedRevision;
  31. }
  32. }
  33. /// <summary>
  34. /// Gets the <see cref="RevSpec"/> identifying the left parent of the changeset
  35. /// that was committed.
  36. /// </summary>
  37. public RevSpec LeftParentRevision
  38. {
  39. get
  40. {
  41. return _LeftParentRevision;
  42. }
  43. }
  44. /// <summary>
  45. /// Gets the <see cref="RevSpec"/> identifying the left parent of the changeset
  46. /// that was committed; or <c>null</c> if this is not a merge changeset.
  47. /// </summary>
  48. public RevSpec RightParentRevision
  49. {
  50. get
  51. {
  52. return _RightParentRevision;
  53. }
  54. }
  55. }
  56. }