DiffCommand Class

Summary

This class implements the "hg diff" command (): diff repository (or selected files).
graph TD Base0["IncludeExcludeCommandBase<T>"]-->Type click Base0 "/Cake.Hg/api/Mercurial/IncludeExcludeCommandBase_1" Base1["MercurialCommandBase<T>"]-->Base0 click Base1 "/Cake.Hg/api/Mercurial/MercurialCommandBase_1" Base2["CommandBase<T>"]-->Base1 click Base2 "/Cake.Hg/api/Mercurial/CommandBase_1" Base3["object"]-->Base2 Interface0["IMercurialCommand<TResult>"]-.->Type click Interface0 "/Cake.Hg/api/Mercurial/IMercurialCommand_1" Interface1["IMercurialCommand"]-.->Type click Interface1 "/Cake.Hg/api/Mercurial/IMercurialCommand" Interface2["ICommand"]-.->Type click Interface2 "/Cake.Hg/api/Mercurial/ICommand" Type["DiffCommand"] class Type type-node

Syntax

public sealed class DiffCommand : IncludeExcludeCommandBase<DiffCommand>, 
    IMercurialCommand<string>, IMercurialCommand, ICommand

Constructors

Name Summary
DiffCommand() Initializes a new instance of the DiffCommand 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.
ChangeIntroducedByRevision RevSpec
Gets or sets the RevSpec identifying a revision, where all changes introduced by that changeset will be returned.
Command string
Gets the command to execute with the Mercurial command line client.
Inherited from CommandBase<T>
ContextLineCount int
Gets or sets the number of lines of context to show for each diff. Use 0 to leave at default. Default value is 0.
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>
ExcludePatterns Collection<T>
Gets the collection of filename patterns to exclude for the command.
Ignore DiffIgnores
Gets or sets the types of changes to ignore. Default value is None.
IncludePatterns Collection<T>
Gets the collection of filename patterns to include for the command.
Names Collection<T>
Gets the collection of names (of files or directories) to revert.
Observer IMercurialCommandObserver
Gets or sets the object that will act as an observer of command execution.
Inherited from CommandBase<T>
OmitDatesFromHeaders bool
Gets or sets a value indicating whether to omit dates from diff headers. Default value is false.
ProduceReverseDiff bool
Gets or sets a value indicating whether to produce a reversal diff, one that would undo the change introduced by the changeset(s). Default value is false.
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>
RecurseSubRepositories bool
Gets or sets a value indicating whether to recurse into subrepositories. Default is false.
Result string
Gets the result from the command line execution, as an appropriately typed value.
Revisions Collection<T>
Gets the collection RevSpec that identifies the revision(s) or the revision range(s) to view a diff of.
ShowFunctions bool
Gets or sets a value indicating whether to show which function each change is in. Default value is false.
SummaryOnly bool
Gets or sets a value indicating whether to output diffstat-style of summary of changes instead of the full diff. Default value is false.
Timeout int
Gets or sets the timeout to use when executing Mercurial commands, in seconds. Default is 60.
Inherited from CommandBase<T>
TreatAllFilesAsText bool
Gets or sets a value indicating whether to treat all files as text. Default value is false.
UseGitDiffFormat bool
Gets or sets a value indicating whether to follow renames and copies when limiting the log. Default is false.

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.
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.
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.)
WithAdditionalArgument(string) T
Adds the value to the AdditionalArguments collection property and returns this instance.
Inherited from CommandBase<T>
WithChangeIntroducedByRevision(RevSpec) DiffCommand
Sets the ChangeIntroducedByRevision property to the specified value and returns this DiffCommand instance.
WithConfigurationOverride(string, string, string) void
Adds a configuration override specification to the AdditionalArguments collection in the form of section.name=value.
WithContextLineCount(int) DiffCommand
Sets the ContextLineCount property to the specified value and returns this DiffCommand instance.
WithExcludePattern(string) T
Adds the value to the ExcludePatterns collection property and returns this instance.
WithGitDiffFormat(bool) DiffCommand
Sets the UseGitDiffFormat property to the specified value and returns this DiffCommand instance.
WithIgnore(DiffIgnores) DiffCommand
Sets the Ignore property to the specified value and returns this DiffCommand instance.
WithIncludePattern(string) T
Adds the value to the IncludePatterns collection property and returns this instance.
WithNames(string[]) DiffCommand
Adds the values to the Names collection property and returns this DiffCommand instance.
WithObserver(IMercurialCommandObserver) T
Sets the Observer property to the specified value and returns this instance.
Inherited from CommandBase<T>
WithOmitDatesFromHeaders(bool) DiffCommand
Sets the OmitDatesFromHeaders property to the specified value and returns this DiffCommand instance.
WithProduceReverseDiff(bool) DiffCommand
Sets the ProduceReverseDiff property to the specified value and returns this DiffCommand instance.
WithRecurseSubRepositories(bool) DiffCommand
Sets the RecurseSubRepositories property to the specified value and returns this DiffCommand instance.
WithRevisions(RevSpec) DiffCommand
Adds the specified value to the Revisions property and returns this DiffCommand instance.
WithShowFunctions(bool) DiffCommand
Sets the ShowFunctions property to the specified value and returns this DiffCommand instance.
WithSummaryOnly(bool) DiffCommand
Sets the SummaryOnly property to the specified value and returns this DiffCommand instance.
WithTimeout(int) T
Sets the Timeout property to the specified value and returns this instance.
Inherited from CommandBase<T>
WithTreatAllFilesAsText(bool) DiffCommand
Sets the TreatAllFilesAsText property to the specified value and returns this DiffCommand instance.
WithUseGitDiffFormat(bool) DiffCommand
Sets the UseGitDiffFormat property to the specified value and returns this DiffCommand instance.

Extension Methods

Name Value Summary
OperateOnPatchRepository<DiffCommand>() T
Makes the command operate on the patch repository instead of the main repository.