public VersionExportStep(VersionHistoryItem historyItem, int stepIndex, int totalNumberOfSteps, bool needsCleanWorkspace)
     : this()
 {
     HistoryItem         = historyItem;
     NeedsCleanWorkspace = needsCleanWorkspace;
     Progress            = Progress.ForStep(stepIndex, totalNumberOfSteps);
 }
Beispiel #2
0
        string FormatCommitMessage(VersionHistoryItem historyItem)
        {
            var standardInputBuilder = new StringBuilder();

            standardInputBuilder.AppendLine(historyItem.Comment);
            standardInputBuilder.AppendLine();
            standardInputBuilder.AppendLine(FormatExportSourceNote(historyItem));

            return(standardInputBuilder.ToString());
        }
Beispiel #3
0
        void CommitFiles(VersionHistoryItem historyItem)
        {
            context.Logger.LogInfo("Committing files to Git...");

            string commitMessage = FormatCommitMessage(historyItem);
            string commitDate    = FormatDateForCommit(historyItem.Date);
            string commitAuthor  = FormatAuthorForCommit(historyItem.Author, context.Parameters.CommitAuthorEmailDomain);

            gitClient.ExecuteCommand(CommitCommand, commitMessage,
                                     new NamedArgument(MessageSourceFileArgument, UseStandardInputArgumentValue),
                                     new NamedArgument(AuthorArgument, commitAuthor), new NamedArgument(DateArgument, commitDate),
                                     new SwitchArgument(AllowEmptySwitchArgument));
        }
Beispiel #4
0
 string FormatExportSourceNote(VersionHistoryItem historyItem)
 {
     return(string.Format(VaultExportSourceNoteFormat, context.Parameters.VaultRepositoryPath,
                          historyItem.Version));
 }
Beispiel #5
0
 public void Execute(VersionHistoryItem historyItem)
 {
     StageFiles();
     CommitFiles(historyItem);
 }