Пример #1
0
        string FormatCommitMessage(VersionHistoryItem historyItem)
        {
            var standardInputBuilder = new StringBuilder();
            standardInputBuilder.AppendLine(historyItem.Comment);
            standardInputBuilder.AppendLine();
            standardInputBuilder.AppendLine(FormatExportSourceNote(historyItem));

            return standardInputBuilder.ToString();
        }
Пример #2
0
        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)));
        }
Пример #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));
        }
Пример #4
0
 string FormatExportSourceNote(VersionHistoryItem historyItem)
 {
     return string.Format(VaultExportSourceNoteFormat, context.Parameters.VaultRepositoryName, context.Parameters.VaultRepositoryPath,
         historyItem.Version);
 }
Пример #5
0
 public void Execute(VersionHistoryItem historyItem)
 {
     StageFiles();
     CommitFiles(historyItem);
 }
Пример #6
0
 public VersionExportStep(VersionHistoryItem historyItem, int stepIndex, int totalNumberOfSteps, bool needsCleanWorkspace)
     : this()
 {
     HistoryItem = historyItem;
     NeedsCleanWorkspace = needsCleanWorkspace;
     Progress = Progress.ForStep(stepIndex, totalNumberOfSteps);
 }