PageRenderTime 21ms CodeModel.GetById 11ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/Mercurial.Net/Hooks/MercurialCommitHook.cs

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