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

C# IGitTfsRemote类代码示例

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

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



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

示例1: DescribeTfsRemotes

 private void DescribeTfsRemotes(IGitTfsRemote remote)
 {
     // add a line of whitespace to improve readability
     stdout.WriteLine();
     stdout.WriteLine("remote tfs id: '{0}' {1} {2}", remote.Id, remote.TfsUrl, remote.TfsRepositoryPath);
     stdout.WriteLine("               {0} - {1} @ {2}", remote.RemoteRef, remote.MaxCommitHash, remote.MaxChangesetId);
 }
开发者ID:JenasysDesign,项目名称:git-tfs,代码行数:7,代码来源:Info.cs


示例2: InitializeRemote

        /// <summary>
        /// Configures a IGitTfsRemote to export metadata
        /// </summary>
        /// <param name="remote"></param>
        /// <param name="shouldExportMetadata"></param>
        public void InitializeRemote(IGitTfsRemote remote, bool shouldExportMetadata)
        {
            remote.ExportMetadatas = shouldExportMetadata;
            remote.ExportWorkitemsMapping = new Dictionary<string, string>();

            if (shouldExportMetadata && File.Exists(exportMetadatasFilePath))
            {
                try
                {
                    foreach (var lineRead in File.ReadAllLines(exportMetadatasFilePath))
                    {
                        if (string.IsNullOrWhiteSpace(lineRead))
                            continue;
                        var values = lineRead.Split('|');
                        var oldWorkitem = values[0].Trim();
                        if (!remote.ExportWorkitemsMapping.ContainsKey(oldWorkitem))
                            remote.ExportWorkitemsMapping.Add(oldWorkitem, values[1].Trim());
                    }
                }
                catch (Exception)
                {
                    throw new GitTfsException("error: bad format of workitems mapping file! One line format should be: OldWorkItemId|NewWorkItemId");
                }
            }
        }
开发者ID:pmiossec,项目名称:git-tfs,代码行数:30,代码来源:ExportMetadatasInitializer.cs


示例3: DoFetch

 protected override void DoFetch(IGitTfsRemote remote, bool stopOnFailMergeCommit)
 {
     if (InitialChangeset.HasValue)
         remote.QuickFetch(InitialChangeset.Value);
     else
         remote.QuickFetch();
 }
开发者ID:EdwinTai,项目名称:git-tfs,代码行数:7,代码来源:QuickFetch.cs


示例4: DoFetch

 protected override void DoFetch(IGitTfsRemote remote)
 {
     if (InitialChangeset.HasValue)
         remote.QuickFetch(InitialChangeset.Value);
     else
         remote.QuickFetch();
 }
开发者ID:runt18,项目名称:git-tfs,代码行数:7,代码来源:QuickFetch.cs


示例5: GetChangesets

 public IEnumerable<ITfsChangeset> GetChangesets(string path, long startVersion, IGitTfsRemote remote, long lastVersion = -1, bool byLots = false)
 {
     if (!_script.Changesets.Any(c => c.IsBranchChangeset) && _script.Changesets.Any(c => c.IsMergeChangeset))
         return _script.Changesets.Where(x => x.Id >= startVersion).Select(x => BuildTfsChangeset(x, remote));
     return _script.Changesets
         .Where(x => x.Id >= startVersion && x.Changes.Any(c => c.RepositoryPath.ToLower().IndexOf(path.ToLower()) == 0 || path.ToLower().IndexOf(c.RepositoryPath.ToLower()) == 0))
         .Select(x => BuildTfsChangeset(x, remote));
 }
开发者ID:JenasysDesign,项目名称:git-tfs,代码行数:8,代码来源:TfsHelper.VsFake.cs


示例6: TfsWorkspace

 public TfsWorkspace(Workspace workspace, string localDirectory, TextWriter stdout, TfsChangesetInfo contextVersion, IGitTfsRemote remote)
 {
     _workspace = workspace;
     _contextVersion = contextVersion;
     _remote = remote;
     _localDirectory = localDirectory;
     _stdout = stdout;
 }
开发者ID:ElegantCode,项目名称:git-tfs,代码行数:8,代码来源:TfsWorkspace.cs


示例7: DoFetch

 protected override void DoFetch(IGitTfsRemote remote)
 {
     if (changeSetId == default(int))
         // Just grab the latest changeset:
         remote.QuickFetch();
     else
         // Use a specific changeset to start from:
         remote.QuickFetch(changeSetId);
 }
开发者ID:nnieslan,项目名称:git-tfs,代码行数:9,代码来源:QuickFetch.cs


示例8: DoFetch

 protected override void DoFetch(IGitTfsRemote remote, bool stopOnFailMergeCommit)
 {
     if (InitialChangeset.HasValue)
         remote.QuickFetch(InitialChangeset.Value);
     else
         remote.QuickFetch();
     _properties.InitialChangeset = remote.MaxChangesetId;
     _properties.PersistAllOverrides();
 }
开发者ID:pmiossec,项目名称:git-tfs,代码行数:9,代码来源:QuickFetch.cs


示例9: GetChangesets

 public IEnumerable<ITfsChangeset> GetChangesets(string path, int startVersion, IGitTfsRemote remote, int lastVersion = -1, bool byLots = false)
 {
     if (!_script.Changesets.Any(c => c.IsBranchChangeset) && _script.Changesets.Any(c => c.IsMergeChangeset))
         return _script.Changesets.Where(x => x.Id >= startVersion).Select(x => BuildTfsChangeset(x, remote));
     var branchPath = path + "/";
     return _script.Changesets
         .Where(x => x.Id >= startVersion && x.Changes.Any(c => c.RepositoryPath.IndexOf(branchPath, StringComparison.CurrentCultureIgnoreCase) == 0 || branchPath.IndexOf(c.RepositoryPath, StringComparison.CurrentCultureIgnoreCase) == 0))
         .Select(x => BuildTfsChangeset(x, remote));
 }
开发者ID:XinChenBug,项目名称:git-tfs,代码行数:9,代码来源:TfsHelper.VsFake.cs


示例10: DoFetch

 protected override void DoFetch(IGitTfsRemote remote)
 {
     if (InitialChangeset.HasValue)
         // Just grab the latest changeset:
         remote.QuickFetch();
     else
         // Use a specific changeset to start from:
         remote.QuickFetch(InitialChangeset.Value);
 }
开发者ID:salty-horse,项目名称:git-tfs,代码行数:9,代码来源:QuickFetch.cs


示例11: DoFetch

 protected virtual void DoFetch(IGitTfsRemote remote)
 {
     // It is possible that we have outdated refs/remotes/tfs/<id>.
     // E.g. someone already fetched changesets from TFS into another git repository and we've pulled it since
     // in that case tfs fetch will retrieve same changes again unnecessarily. To prevent it we will scan tree from HEAD and see if newer changesets from
     // TFS exists (by checking git-tfs-id mark in commit's comments).
     // The process is similar to bootstrapping.
     globals.Repository.MoveTfsRefForwardIfNeeded(remote);
     remote.Fetch();
 }
开发者ID:runt18,项目名称:git-tfs,代码行数:10,代码来源:Fetch.cs


示例12: 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


示例13: InitMocks4Tests

        private void InitMocks4Tests(out IGitRepository gitRepository, out IGitTfsRemote remote)
        {
            // mock git repository
            gitRepository = _mocks.Get<IGitRepository>();
            gitRepository.Stub(r => r.HasRemote(Arg<string>.Is.Anything)).Return(true);
            _mocks.Get<Globals>().Repository = gitRepository;

            // mock tfs remote
            _mocks.Get<Globals>().UserSpecifiedRemoteId = "default";
            remote = MockRepository.GenerateStub<IGitTfsRemote>();
            gitRepository.Stub(r => r.ReadTfsRemote(Arg<string>.Is.Anything)).Return(remote);
        }
开发者ID:git-tfs,项目名称:git-tfs,代码行数:12,代码来源:ShelveDeleteTest.cs


示例14: CreateLabelsForTfsBranch

        private int CreateLabelsForTfsBranch(IGitTfsRemote tfsRemote)
        {
            if (string.IsNullOrWhiteSpace(NameFilter))
                NameFilter = null;
            else
                NameFilter = NameFilter.Trim();

            UpdateRemote(tfsRemote);
            _stdout.WriteLine("Looking for label on " + tfsRemote.TfsRepositoryPath + "...");
            var labels = tfsRemote.Tfs.GetLabels(tfsRemote.TfsRepositoryPath, NameFilter);
            _stdout.WriteLine(labels.Count() +" labels found!");

            Regex exludeRegex = null;
            if (ExcludeNameFilter != null)
                exludeRegex = new Regex(ExcludeNameFilter);

            foreach (var label in labels)
            {
                if (ExcludeNameFilter != null && exludeRegex.IsMatch(label.Name))
                    continue;

                Trace.WriteLine("LabelId:" + label.Id + "/ChangesetId:" + label.ChangesetId + "/LabelName:" + label.Name + "/Owner:" + label.Owner);
                Trace.WriteLine("Try to find changeset in git repository...");
                string sha1TagCommit = _globals.Repository.FindCommitHashByChangesetId(label.ChangesetId);
                if (string.IsNullOrWhiteSpace(sha1TagCommit))
                {
                    Trace.WriteLine("This label does not match an existing commit...");
                    continue;
                }
                Trace.WriteLine("Commit found! sha1 : " + sha1TagCommit);

                string ownerName;
                string ownerEmail;
                if(_authors.Authors.ContainsKey(label.Owner))
                {
                    var author = _authors.Authors[label.Owner];
                    ownerName = author.Name;
                    ownerEmail = author.Email;
                }
                else
                {
                    ownerName = label.Owner;
                    ownerEmail = label.Owner;
                }
                var labelName = (label.IsTransBranch ? label.Name + "(" + tfsRemote.Id + ")" : label.Name).ToGitRefName();
                _stdout.WriteLine("Writing label '" + labelName + "'...");
                _globals.Repository.CreateTag(labelName, sha1TagCommit, label.Comment, ownerName, ownerEmail ,label.Date);
            }
            return GitTfsExitCodes.OK;
        }
开发者ID:XinChenBug,项目名称:git-tfs,代码行数:50,代码来源:Labels.cs


示例15: InitMocks4Tests

        private void InitMocks4Tests(string gitBranchToInit, out IGitRepository gitRepository, out IGitTfsRemote remote, out IGitTfsRemote newBranchRemote)
        {
            gitRepository = mocks.Get<IGitRepository>();
            mocks.Get<Globals>().Repository = gitRepository;
            mocks.Get<Globals>().GitDir = ".git";
            remote = MockRepository.GenerateStub<IGitTfsRemote>();
            remote.TfsUsername = "user";
            remote.TfsPassword = "pwd";
            remote.TfsRepositoryPath = "$/MyProject/Trunk";
            remote.TfsUrl = "http://myTfsServer:8080/tfs";
            remote.Tfs = new VsFake.TfsHelper(mocks.Container, null, null);
            gitRepository.Stub(r => r.GitDir).Return(".");

            newBranchRemote = MockRepository.GenerateStub<IGitTfsRemote>();
            newBranchRemote.Id = gitBranchToInit;
        }
开发者ID:runt18,项目名称:git-tfs,代码行数:16,代码来源:InitBranchTest.cs


示例16: DescribeTfsRemotes

 private void DescribeTfsRemotes(IGitTfsRemote remote)
 {
     DisplayReadabilityLineJump();
     _stdout.WriteLine("remote tfs id: '{0}' {1} {2}", remote.Id, remote.TfsUrl, remote.TfsRepositoryPath);
     _stdout.WriteLine("               {0} - {1} @ {2}", remote.RemoteRef, remote.MaxCommitHash, remote.MaxChangesetId);
 }
开发者ID:XinChenBug,项目名称:git-tfs,代码行数:6,代码来源:Info.cs


示例17: FindTfsRepositoryPathOfMergedBranch

        private string FindTfsRepositoryPathOfMergedBranch(IGitTfsRemote remoteToCheckin, string[] gitParents, string target)
        {
            var repo = remoteToCheckin.Repository;
            if (gitParents.Length != 0)
            {
                _stdout.WriteLine("Working on the merge commit: " + target);
                if (gitParents.Length > 1)
                    _stdout.WriteLine("warning: only 1 parent is supported by TFS for a merge changeset. The other parents won't be materialized in the TFS merge!");
                foreach (var gitParent in gitParents)
                {
                    var tfsCommit = repo.GetTfsCommit(gitParent);
                    if (tfsCommit != null)
                        return tfsCommit.Remote.TfsRepositoryPath;
                    var lastCheckinCommit = repo.GetLastParentTfsCommits(gitParent).First();
                    if (lastCheckinCommit != null)
                    {
                        if(!ForceCheckin && lastCheckinCommit.Remote.Id != remoteToCheckin.Id)
                            throw new GitTfsException("error: the merged branch '" + lastCheckinCommit.Remote.Id
                                + "' is a TFS tracked branch ("+lastCheckinCommit.Remote.TfsRepositoryPath
                                + ") with some commits not checked in.\nIn this case, the local merge won't be materialized as a merge in tfs...")
                                .WithRecommendation("check in all the commits of the tfs merged branch in TFS before trying to check in a merge commit",
                                "use --ignore-merge option to ignore merged TFS branch and check in commit as a normal changeset (not a merge).");
                    }

                    _stdout.WriteLine("warning: the parent " + gitParent + " does not belong to a TFS tracked branch (not checked in TFS) and will be ignored!");
                }
            }
            return null;
        }
开发者ID:cecilkilmer,项目名称:git-tfs,代码行数:29,代码来源:Rcheckin.cs


示例18: BuildTfsChangeset

 private ITfsChangeset BuildTfsChangeset(ScriptedChangeset changeset, IGitTfsRemote remote)
 {
     var tfsChangeset = _container.With<ITfsHelper>(this).With<IChangeset>(new Changeset(_versionControlServer, changeset)).GetInstance<TfsChangeset>();
     tfsChangeset.Summary = new TfsChangesetInfo { ChangesetId = changeset.Id, Remote = remote };
     return tfsChangeset;
 }
开发者ID:davidalpert,项目名称:git-tfs,代码行数:6,代码来源:TfsHelper.VsFake.cs


示例19: WithWorkspace

 public void WithWorkspace(string directory, IGitTfsRemote remote, TfsChangesetInfo versionToFetch, Action<ITfsWorkspace> action)
 {
     Trace.WriteLine("Setting up a TFS workspace at " + directory);
     var fakeWorkspace = new FakeWorkspace(directory, remote.TfsRepositoryPath);
     var workspace = _container.With("localDirectory").EqualTo(directory)
         .With("remote").EqualTo(remote)
         .With("contextVersion").EqualTo(versionToFetch)
         .With("workspace").EqualTo(fakeWorkspace)
         .With("tfsHelper").EqualTo(this)
         .GetInstance<TfsWorkspace>();
     action(workspace);
 }
开发者ID:davidalpert,项目名称:git-tfs,代码行数:12,代码来源:TfsHelper.VsFake.cs


示例20: ListShelvesets

 public int ListShelvesets(ShelveList shelveList, IGitTfsRemote remote)
 {
     throw new NotImplementedException();
 }
开发者ID:davidalpert,项目名称:git-tfs,代码行数:4,代码来源:TfsHelper.VsFake.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# IGitUICommands类代码示例发布时间:2022-05-24
下一篇:
C# IGitHubClient类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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