MercurialCommandBase<T> Class

Summary

This is the base class for option classes for various commands for the Mercurial client.
graph TD Base0["CommandBase<T>"]-->Type click Base0 "/Cake.Hg/api/Mercurial/CommandBase_1" Base1["object"]-->Base0 Interface0["IMercurialCommand"]-.->Type click Interface0 "/Cake.Hg/api/Mercurial/IMercurialCommand" Interface1["ICommand"]-.->Type click Interface1 "/Cake.Hg/api/Mercurial/ICommand" Type["MercurialCommandBase<T>"] class Type type-node Type-->Derived0["UpdateCommand"] click Derived0 "/Cake.Hg/api/Mercurial/UpdateCommand" Type-->Derived1["BundleCommand"] click Derived1 "/Cake.Hg/api/Mercurial/BundleCommand" Type-->Derived2["SummaryCommand"] click Derived2 "/Cake.Hg/api/Mercurial/SummaryCommand" Type-->Derived3["IdentifyCommand"] click Derived3 "/Cake.Hg/api/Mercurial/IdentifyCommand" Type-->Derived4["PathsCommand"] click Derived4 "/Cake.Hg/api/Mercurial/PathsCommand" Type-->Derived5["AnnotateCommand"] click Derived5 "/Cake.Hg/api/Mercurial/AnnotateCommand" Type-->Derived6["ParentsCommand"] click Derived6 "/Cake.Hg/api/Mercurial/ParentsCommand" Type-->Derived7["HeadsCommand"] click Derived7 "/Cake.Hg/api/Mercurial/HeadsCommand" Type-->Derived8["ShowConfigCommand"] click Derived8 "/Cake.Hg/api/Mercurial/ShowConfigCommand" Type-->Derived9["RecoverCommand"] click Derived9 "/Cake.Hg/api/Mercurial/RecoverCommand" Type-->Derived10["OutgoingCommand"] click Derived10 "/Cake.Hg/api/Mercurial/OutgoingCommand" Type-->Derived11["InitCommand"] click Derived11 "/Cake.Hg/api/Mercurial/InitCommand" Type-->Derived12["VersionCommand"] click Derived12 "/Cake.Hg/api/Mercurial/VersionCommand" Type-->Derived13["HelpCommand"] click Derived13 "/Cake.Hg/api/Mercurial/HelpCommand" Type-->Derived14["UnbundleCommand"] click Derived14 "/Cake.Hg/api/Mercurial/UnbundleCommand" Type-->Derived15["BookmarkCommand"] click Derived15 "/Cake.Hg/api/Mercurial/BookmarkCommand" Type-->Derived16["BisectCommand"] click Derived16 "/Cake.Hg/api/Mercurial/BisectCommand" Type-->Derived17["VerifyCommand"] click Derived17 "/Cake.Hg/api/Mercurial/VerifyCommand" Type-->Derived18["BranchesCommand"] click Derived18 "/Cake.Hg/api/Mercurial/BranchesCommand" Type-->Derived19["PushCommand"] click Derived19 "/Cake.Hg/api/Mercurial/PushCommand" Type-->Derived20["CloneCommand"] click Derived20 "/Cake.Hg/api/Mercurial/CloneCommand" Type-->Derived21["PullCommand"] click Derived21 "/Cake.Hg/api/Mercurial/PullCommand" Type-->Derived22["ManifestCommand"] click Derived22 "/Cake.Hg/api/Mercurial/ManifestCommand" Type-->Derived23["TagsCommand"] click Derived23 "/Cake.Hg/api/Mercurial/TagsCommand" Type-->Derived24["BookmarksCommand"] click Derived24 "/Cake.Hg/api/Mercurial/BookmarksCommand" Type-->Derived25["IncomingCommand"] click Derived25 "/Cake.Hg/api/Mercurial/IncomingCommand" Type-->Derived26["TipCommand"] click Derived26 "/Cake.Hg/api/Mercurial/TipCommand" Type-->Derived27["MergeCommand"] click Derived27 "/Cake.Hg/api/Mercurial/MergeCommand" Type-->Derived28["RollbackCommand"] click Derived28 "/Cake.Hg/api/Mercurial/RollbackCommand" Type-->Derived29["StatusCommand"] click Derived29 "/Cake.Hg/api/Mercurial/StatusCommand" Type-->Derived30["RemoteInitCommand"] click Derived30 "/Cake.Hg/api/Mercurial/RemoteInitCommand" Type-->Derived31["TagCommand"] click Derived31 "/Cake.Hg/api/Mercurial/TagCommand" Type-->Derived32["IncludeExcludeCommandBase<T>"] click Derived32 "/Cake.Hg/api/Mercurial/IncludeExcludeCommandBase_1" Type-->Derived33["BranchCommand"] click Derived33 "/Cake.Hg/api/Mercurial/BranchCommand"

Syntax

public abstract class MercurialCommandBase<T> : CommandBase<T>, IMercurialCommand, ICommand 
    where T : MercurialCommandBase<T>

Type Parameters

Name Description
T The actual type descending from MercurialCommandBase<T>, used to generate type-correct methods in this base class.

Constructors

Name Summary
MercurialCommandBase(string) Initializes a new instance of the MercurialCommandBase<T> class.

Properties

Name Value Summary
AdditionalArguments Collection<T>
Gets the collection which additional arguments can be added into. This collection is exposed for extensions, so that they have a place to add all their extra arguments to the Mercurial command line client.
Inherited from CommandBase<T>
Arguments IEnumerable<T>
Gets all the arguments to the Command, or an empty array if there are none.
Inherited from CommandBase<T>
Command string
Gets the command to execute with the Mercurial command line client.
Inherited from CommandBase<T>
DebugOutput bool
Gets or sets a value indicating whether to enable debug output on the command. This should only be used by the command code itself, never by the user.
Inherited from CommandBase<T>
Observer IMercurialCommandObserver
Gets or sets the object that will act as an observer of command execution.
Inherited from CommandBase<T>
RawExitCode int
Gets the raw exit code from executing the command line client.
Inherited from CommandBase<T>
RawStandardErrorOutput string
Gets the raw standard error output from executing the command line client.
Inherited from CommandBase<T>
RawStandardOutput string
Gets the raw standard output from executing the command line client.
Inherited from CommandBase<T>
Timeout int
Gets or sets the timeout to use when executing Mercurial commands, in seconds. Default is 60.
Inherited from CommandBase<T>

Methods

Name Value Summary
AddArgument(string) void
Adds the specified argument to the AdditionalArguments collection, unless it is already present.
Inherited from CommandBase<T>
After(int, string, string) void
This method is called after the command has been executed. You can use this to clean up after the command execution (like removing temporary files), and to react to the exit code from the command line client. If the exit code is considered a failure, this method should throw the correct exception.
Inherited from CommandBase<T>
Before() void
This method is called before the command is executed. You can use this to store temporary files (like a commit message or similar) that the Arguments refer to, before the command is executed.
Inherited from CommandBase<T>
Cleanup() void
Override this method to implement code that will execute after command line execution.
Inherited from CommandBase<T>
ParseStandardOutputForResults(int, string) void
This method should parse and store the appropriate execution result output according to the type of data the command line client would return for the command.
Inherited from CommandBase<T>
Prepare() void
Override this method to implement code that will execute before command line execution.
Inherited from CommandBase<T>
RequiresVersion(Version, string) void
This method will check the current client version and throw a System.NotSupportedException if the current client version is older than the required one.
ThrowOnUnsuccessfulExecution(int, string) void
This method should throw the appropriate exception depending on the contents of the exitCode and standardErrorOutput parameters, or simply return if the execution is considered successful.
Inherited from CommandBase<T>
Validate() void
Validates the command configuration. This method should throw the necessary exceptions to signal missing or incorrect configuration (like attempting to add files to the repository without specifying which files to add.)
Inherited from CommandBase<T>
WithAdditionalArgument(string) T
Adds the value to the AdditionalArguments collection property and returns this instance.
Inherited from CommandBase<T>
WithConfigurationOverride(string, string, string) void
Adds a configuration override specification to the AdditionalArguments collection in the form of section.name=value.
WithObserver(IMercurialCommandObserver) T
Sets the Observer property to the specified value and returns this instance.
Inherited from CommandBase<T>
WithTimeout(int) T
Sets the Timeout property to the specified value and returns this instance.
Inherited from CommandBase<T>