string FormatCommitMessage(VersionHistoryItem historyItem) { var standardInputBuilder = new StringBuilder(); standardInputBuilder.AppendLine(historyItem.Comment); standardInputBuilder.AppendLine(); standardInputBuilder.AppendLine(FormatExportSourceNote(historyItem)); return standardInputBuilder.ToString(); }
IEnumerable<VersionExportStep> GetExportSteps(VersionHistoryItem[] historyItems, int beginVersion, int endVersion) { var transactionsWithDeletion = GetTransactionsWithDeletion(beginVersion, endVersion); return historyItems.Select( (item, idx) => new VersionExportStep(item, idx, historyItems.Length, transactionsWithDeletion.Contains(item.TransactionId))); }
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)); }
string FormatExportSourceNote(VersionHistoryItem historyItem) { return string.Format(VaultExportSourceNoteFormat, context.Parameters.VaultRepositoryName, context.Parameters.VaultRepositoryPath, historyItem.Version); }
public void Execute(VersionHistoryItem historyItem) { StageFiles(); CommitFiles(historyItem); }
public VersionExportStep(VersionHistoryItem historyItem, int stepIndex, int totalNumberOfSteps, bool needsCleanWorkspace) : this() { HistoryItem = historyItem; NeedsCleanWorkspace = needsCleanWorkspace; Progress = Progress.ForStep(stepIndex, totalNumberOfSteps); }