• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Commands.CheckinOptions类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: BuildCommitSpecificCheckinOptions

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

            customCheckinOptions.CheckinComment = commitMessage;

            customCheckinOptions.ProcessWorkItemCommands();

            customCheckinOptions.ProcessCheckinNoteCommands();

            customCheckinOptions.ProcessForceCommand();

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


示例17: Sets_commit_message_as_checkin_comments

        public void Sets_commit_message_as_checkin_comments()
        {
            string originalCheckinComment = "command-line input";
            var singletonCheckinOptions = new CheckinOptions
            {
                CheckinComment = originalCheckinComment
            };

            string commitMessage = @"test message

		formatted git commit message";

            var specificCheckinOptions = GetCheckinOptionsFactory().BuildCommitSpecificCheckinOptions(singletonCheckinOptions, commitMessage);
            Assert.Equal(commitMessage, specificCheckinOptions.CheckinComment);
        }
开发者ID:XinChenBug,项目名称:git-tfs,代码行数:15,代码来源:CommitSpecificCheckinOptionsFactoryTests.cs


示例18: Clone

        private CheckinOptions Clone(CheckinOptions source)
        {
            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);

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


示例19: Checkin_failed

        public void Checkin_failed()
        {
            IWorkspace workspace = MockRepository.GenerateStub<IWorkspace>();
            string localDirectory = string.Empty;
            TextWriter writer = new StringWriter();
            TfsChangesetInfo contextVersion = MockRepository.GenerateStub<TfsChangesetInfo>();
            IGitTfsRemote remote = MockRepository.GenerateStub<IGitTfsRemote>();
            remote.Repository = MockRepository.GenerateStub<IGitRepository>();
            CheckinOptions checkinOptions = new CheckinOptions();
            ITfsHelper tfsHelper = MockRepository.GenerateStub<ITfsHelper>();
            CheckinPolicyEvaluator policyEvaluator = new CheckinPolicyEvaluator();

            TfsWorkspace tfsWorkspace = new TfsWorkspace(workspace, localDirectory, writer, contextVersion, remote, checkinOptions, tfsHelper, policyEvaluator);

            IPendingChange pendingChange = MockRepository.GenerateStub<IPendingChange>();
            IPendingChange[] allPendingChanges = new IPendingChange[] { pendingChange };
            workspace.Stub(w => w.GetPendingChanges()).Return(allPendingChanges);

            ICheckinEvaluationResult checkinEvaluationResult =
                new StubbedCheckinEvaluationResult();

            workspace.Stub(w => w.EvaluateCheckin(
                                    Arg<TfsCheckinEvaluationOptions>.Is.Anything,
                                    Arg<IPendingChange[]>.Is.Anything,
                                    Arg<IPendingChange[]>.Is.Anything,
                                    Arg<string>.Is.Anything,
                                    Arg<string>.Is.Anything,
                                    Arg<ICheckinNote>.Is.Anything,
                                    Arg<IEnumerable<IWorkItemCheckinInfo>>.Is.Anything))
                    .Return(checkinEvaluationResult);

            workspace.Expect(w => w.Checkin(
                                    Arg<IPendingChange[]>.Is.Anything,
                                    Arg<string>.Is.Anything,
                                    Arg<string>.Is.Anything,
                                    Arg<ICheckinNote>.Is.Anything,
                                    Arg<IEnumerable<IWorkItemCheckinInfo>>.Is.Anything,
                                    Arg<TfsPolicyOverrideInfo>.Is.Anything,
                                    Arg<bool>.Is.Anything))
                      .Return(0);

            var ex = Assert.Throws<GitTfsException>(() =>
            {
                var result = tfsWorkspace.Checkin(checkinOptions);
            });

            Assert.Equal("Checkin failed!", ex.Message);
        }
开发者ID:XinChenBug,项目名称:git-tfs,代码行数:48,代码来源:TfsWorkspaceTests.cs


示例20: ProcessForceCommand

        private void ProcessForceCommand(CheckinOptions checkinOptions, TextWriter writer)
        {
            MatchCollection workitemMatches;
            if ((workitemMatches = GitTfsConstants.TfsForceRegex.Matches(checkinOptions.CheckinComment)).Count == 1)
            {
                string overrideReason = workitemMatches[0].Groups["reason"].Value;

                if (!string.IsNullOrWhiteSpace(overrideReason))
                {
                    writer.WriteLine("Forcing the checkin: {0}", overrideReason);
                    checkinOptions.Force = true;
                    checkinOptions.OverrideReason = overrideReason;
                }
                checkinOptions.CheckinComment = GitTfsConstants.TfsForceRegex.Replace(checkinOptions.CheckinComment, "").Trim(' ', '\r', '\n');
            }
        }
开发者ID:vansha,项目名称:git-tfs,代码行数:16,代码来源:CommitSpecificCheckinOptionsFactory.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Commands.RemoteOptions类代码示例发布时间:2022-05-26
下一篇:
C# SendGrid.Web类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap