当前位置: 首页>>代码示例>>C#>>正文


C# Commands.CheckinOptions类代码示例

本文整理汇总了C#中Sep.Git.Tfs.Commands.CheckinOptions的典型用法代码示例。如果您正苦于以下问题:C# CheckinOptions类的具体用法?C# CheckinOptions怎么用?C# CheckinOptions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


CheckinOptions类属于Sep.Git.Tfs.Commands命名空间,在下文中一共展示了CheckinOptions类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Rcheckin

 public Rcheckin(TextWriter stdout, CheckinOptions checkinOptions, TfsWriter writer)
 {
     _stdout = stdout;
     _checkinOptions = checkinOptions;
     _checkinOptionsFactory = new CommitSpecificCheckinOptionsFactory(_stdout);
     _writer = writer;
 }
开发者ID:vitalybe,项目名称:git-tfs,代码行数:7,代码来源:Rcheckin.cs

示例2: Shelve

 public Shelve(CheckinOptions checkinOptions, TfsWriter writer, Globals globals)
 {
     _globals = globals;
     _checkinOptions = checkinOptions;
     _checkinOptionsFactory = new CheckinOptionsFactory(_globals);
     _writer = writer;
 }
开发者ID:pmiossec,项目名称:git-tfs,代码行数:7,代码来源:Shelve.cs

示例3: Adds_work_item_to_associate_and_removes_checkin_command_comment

        public void Adds_work_item_to_associate_and_removes_checkin_command_comment()
        {
            StringWriter textWriter = new StringWriter();
            CommitSpecificCheckinOptionsFactory factory = new CommitSpecificCheckinOptionsFactory(textWriter);

            CheckinOptions singletonCheckinOptions = new CheckinOptions();

            string commitMessage =
@"test message

		formatted git commit message

		git-tfs-work-item: 1234 associate";

            string expectedCheckinComment =
@"test message

		formatted git commit message

		";

            var specificCheckinOptions = factory.BuildCommitSpecificCheckinOptions(singletonCheckinOptions, commitMessage);

            Assert.Equal(1, specificCheckinOptions.WorkItemsToAssociate.Count);
            Assert.Contains("1234", specificCheckinOptions.WorkItemsToAssociate);
            Assert.Equal(expectedCheckinComment, specificCheckinOptions.CheckinComment);
        }
开发者ID:runt18,项目名称:git-tfs,代码行数:27,代码来源:CommitSpecificCheckinOptionsFactoryTests.cs

示例4: Adds_work_item_to_resolve_and_removes_checkin_command_comment

        public void Adds_work_item_to_resolve_and_removes_checkin_command_comment()
        {
            StringWriter textWriter = new StringWriter();
            CommitSpecificCheckinOptionsFactory factory = new CommitSpecificCheckinOptionsFactory(textWriter);

            CheckinOptions singletonCheckinOptions = new CheckinOptions();

            string commitMessage =
@"test message

		formatted git commit message

		git-tfs-work-item: 1234 resolve";

            string expectedCheckinComment =
@"test message

		formatted git commit message

		";

            var specificCheckinOptions = factory.BuildCommitSpecificCheckinOptions(singletonCheckinOptions, commitMessage);
            Assert.Equal(1, specificCheckinOptions.WorkItemsToResolve.Count);
            Assert.Contains("1234", specificCheckinOptions.WorkItemsToResolve);
            Assert.Equal(expectedCheckinComment.Replace(Environment.NewLine, "NEWLINE"), specificCheckinOptions.CheckinComment.Replace(Environment.NewLine, "NEWLINE"));
        }
开发者ID:runt18,项目名称:git-tfs,代码行数:26,代码来源:CommitSpecificCheckinOptionsFactoryTests.cs

示例5: Clone

        public static CheckinOptions Clone(this CheckinOptions source, Globals globals)
        {
            CheckinOptions clone = new CheckinOptions();

            clone.CheckinComment = source.CheckinComment;
            clone.NoGenerateCheckinComment = source.NoGenerateCheckinComment;
            clone.NoMerge = source.NoMerge;
            clone.OverrideReason = source.OverrideReason;
            clone.Force = source.Force;
            clone.OverrideGatedCheckIn = source.OverrideGatedCheckIn;
            clone.WorkItemsToAssociate.AddRange(source.WorkItemsToAssociate);
            clone.WorkItemsToResolve.AddRange(source.WorkItemsToResolve);
            clone.AuthorTfsUserId = source.AuthorTfsUserId;
            try
            {
                string re = globals.Repository.GetConfig(GitTfsConstants.WorkItemAssociateRegexConfigKey);
                if (String.IsNullOrEmpty(re))
                    clone.WorkItemAssociateRegex = GitTfsConstants.TfsWorkItemAssociateRegex;
                else
                    clone.WorkItemAssociateRegex = new Regex(re);
            }
            catch (Exception)
            {
                clone.WorkItemAssociateRegex = null;
            }
            foreach (var note in source.CheckinNotes)
            {
                clone.CheckinNotes[note.Key] = note.Value;
            }

            return clone;
        }
开发者ID:XinChenBug,项目名称:git-tfs,代码行数:32,代码来源:CheckinOptionsExtensions.cs

示例6: Adds_reviewers_and_removes_checkin_command_comment

        public void Adds_reviewers_and_removes_checkin_command_comment()
        {
            StringWriter textWriter = new StringWriter();
            CommitSpecificCheckinOptionsFactory factory = new CommitSpecificCheckinOptionsFactory(textWriter, new Globals());

            CheckinOptions checkinOptions = new CheckinOptions();

            string commitMessage =
                "Test message\n" +
                "\n" +
                "Some more information,\n" +
                "in a paragraph.\n" +
                "\n" +
                "git-tfs-code-reviewer: John Smith\n" +
                "git-tfs-security-reviewer: Teddy Knox\n" +
                "git-tfs-performance-reviewer: Liam Fasterson";

            string expectedCheckinComment =
                "Test message\n" +
                "\n" +
                "Some more information,\n" +
                "in a paragraph.";

            var specificCheckinOptions = factory.BuildCommitSpecificCheckinOptions(checkinOptions, commitMessage);
            Assert.Equal(3, specificCheckinOptions.CheckinNotes.Count);
            Assert.Equal("John Smith", specificCheckinOptions.CheckinNotes["Code Reviewer"]);
            Assert.Equal("Teddy Knox", specificCheckinOptions.CheckinNotes["Security Reviewer"]);
            Assert.Equal("Liam Fasterson", specificCheckinOptions.CheckinNotes["Performance Reviewer"]);
            Assert.Equal(expectedCheckinComment, specificCheckinOptions.CheckinComment);
        }
开发者ID:patthoyts,项目名称:git-tfs,代码行数:30,代码来源:CommitSpecificCheckinOptionsFactoryTests.cs

示例7: ProcessCheckinNoteCommands

 private void ProcessCheckinNoteCommands(CheckinOptions checkinOptions, TextWriter writer)
 {
     foreach (Match match in GitTfsConstants.TfsReviewerRegex.Matches(checkinOptions.CheckinComment))
     {
         string reviewer = match.Groups["reviewer"].Value;
         if (!string.IsNullOrWhiteSpace(reviewer))
         {
             switch (match.Groups["type"].Value)
             {
                 case "code":
                     writer.WriteLine("Code reviewer: {0}", reviewer);
                     checkinOptions.CheckinNotes.Add("Code Reviewer", reviewer);
                     break;
                 case "security":
                     writer.WriteLine("Security reviewer: {0}", reviewer);
                     checkinOptions.CheckinNotes.Add("Security Reviewer", reviewer);
                     break;
                 case "performance":
                     writer.WriteLine("Performance reviewer: {0}", reviewer);
                     checkinOptions.CheckinNotes.Add("Performance Reviewer", reviewer);
                     break;
             }
         }
     }
     checkinOptions.CheckinComment = GitTfsConstants.TfsReviewerRegex.Replace(checkinOptions.CheckinComment, "").Trim(' ', '\r', '\n');
 }
开发者ID:runt18,项目名称:git-tfs,代码行数:26,代码来源:CommitSpecificCheckinOptionsFactory.cs

示例8: Rcheckin

 public Rcheckin(TextWriter stdout, CheckinOptions checkinOptions, TfsWriter writer, Globals globals)
 {
     _stdout = stdout;
     _checkinOptions = checkinOptions;
     _checkinOptionsFactory = new CommitSpecificCheckinOptionsFactory(_stdout, globals);
     _writer = writer;
     _globals = globals;
 }
开发者ID:patthoyts,项目名称:git-tfs,代码行数:8,代码来源:Rcheckin.cs

示例9: Rcheckin

 public Rcheckin(CheckinOptions checkinOptions, TfsWriter writer, Globals globals, AuthorsFile authors)
 {
     _checkinOptions = checkinOptions;
     _checkinOptionsFactory = new CheckinOptionsFactory(globals);
     _writer = writer;
     _globals = globals;
     _authors = authors;
 }
开发者ID:pmiossec,项目名称:git-tfs,代码行数:8,代码来源:Rcheckin.cs

示例10: Shelve

 public Shelve(TextWriter stdout, CheckinOptions checkinOptions, TfsWriter writer, Globals globals)
 {
     _stdout = stdout;
     _globals = globals;
     _checkinOptions = checkinOptions;
     _checkinOptionsFactory = new CheckinOptionsFactory(_stdout, _globals);
     _writer = writer;
 }
开发者ID:XinChenBug,项目名称:git-tfs,代码行数:8,代码来源:Shelve.cs

示例11: Rcheckin

 public Rcheckin(TextWriter stdout, CheckinOptions checkinOptions, TfsWriter writer, Globals globals, AuthorsFile authors)
 {
     _stdout = stdout;
     _checkinOptions = checkinOptions;
     _checkinOptionsFactory = new CheckinOptionsFactory(_stdout, globals);
     _writer = writer;
     _globals = globals;
     _authors = authors;
 }
开发者ID:XinChenBug,项目名称:git-tfs,代码行数:9,代码来源:Rcheckin.cs

示例12: BuildCommitSpecificCheckinOptions

        public CheckinOptions BuildCommitSpecificCheckinOptions(CheckinOptions sourceCheckinOptions,
            string commitMessage, GitCommit commit, AuthorsFile authors)
        {
            var customCheckinOptions = BuildCommitSpecificCheckinOptions(sourceCheckinOptions, commitMessage);

            customCheckinOptions.ProcessAuthor(writer, commit, authors);

            return customCheckinOptions;
        }
开发者ID:NathanLBCooper,项目名称:git-tfs,代码行数:9,代码来源:CheckinOptionsFactory.cs

示例13: TfsWorkspace

 public TfsWorkspace(IWorkspace workspace, string localDirectory, TextWriter stdout, TfsChangesetInfo contextVersion, IGitTfsRemote remote, CheckinOptions checkinOptions, ITfsHelper tfsHelper)
 {
     _workspace = workspace;
     _contextVersion = contextVersion;
     _remote = remote;
     _checkinOptions = checkinOptions;
     _tfsHelper = tfsHelper;
     _localDirectory = localDirectory;
     _stdout = stdout;
 }
开发者ID:anonymustard,项目名称:git-tfs,代码行数:10,代码来源:TfsWorkspace.cs

示例14: BuildShelveSetSpecificCheckinOptions

        public CheckinOptions BuildShelveSetSpecificCheckinOptions(CheckinOptions sourceCheckinOptions,
            string commitMessage)
        {
            var customCheckinOptions = sourceCheckinOptions.Clone(this.globals);

            customCheckinOptions.CheckinComment = commitMessage;

            customCheckinOptions.ProcessWorkItemCommands(writer, false);

            return customCheckinOptions;
        }
开发者ID:XinChenBug,项目名称:git-tfs,代码行数:11,代码来源:CheckinOptionsFactory.cs

示例15: BuildCommitSpecificCheckinOptions

        public CheckinOptions BuildCommitSpecificCheckinOptions(CheckinOptions sourceCheckinOptions, string commitMessage)
        {
            var customCheckinOptions = Clone(sourceCheckinOptions);

            customCheckinOptions.CheckinComment = commitMessage;

            ProcessWorkItemCommands(customCheckinOptions, writer);

            ProcessForceCommand(customCheckinOptions, writer);

            return customCheckinOptions;
        }
开发者ID:vansha,项目名称:git-tfs,代码行数:12,代码来源:CommitSpecificCheckinOptionsFactory.cs


注:本文中的Sep.Git.Tfs.Commands.CheckinOptions类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。