PageRenderTime 38ms CodeModel.GetById 11ms app.highlight 3ms RepoModel.GetById 22ms app.codeStats 0ms

/Mercurial.Net/Hooks/MercurialPreTransactionCommitHook.cs

#
C# | 66 lines | 30 code | 5 blank | 31 comment | 0 complexity | ddf210b07bd0890c77c706e17d72381b MD5 | raw file
 1namespace 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
21        /// <summary>
22        /// This is the backing field for the <see cref="LeftParentRevision"/> property.
23        /// </summary>
24        private readonly RevSpec _LeftParentRevision = LoadRevision("HG_PARENT1");
25
26        /// <summary>
27        /// This is the backing field for the <see cref="RightParentRevision"/> property.
28        /// </summary>
29        private readonly RevSpec _RightParentRevision = LoadRevision("HG_PARENT2");
30
31        /// <summary>
32        /// Gets the <see cref="RevSpec"/> identifying the revision that was committed.
33        /// </summary>
34        public RevSpec CommittedRevision
35        {
36            get
37            {
38                return _CommittedRevision;
39            }
40        }
41
42        /// <summary>
43        /// Gets the <see cref="RevSpec"/> identifying the left parent of the changeset
44        /// that was committed.
45        /// </summary>
46        public RevSpec LeftParentRevision
47        {
48            get
49            {
50                return _LeftParentRevision;
51            }
52        }
53
54        /// <summary>
55        /// Gets the <see cref="RevSpec"/> identifying the left parent of the changeset
56        /// that was committed; or <c>null</c> if this is not a merge changeset.
57        /// </summary>
58        public RevSpec RightParentRevision
59        {
60            get
61            {
62                return _RightParentRevision;
63            }
64        }
65    }
66}