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


C# ITfsWorkspace类代码示例

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


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

示例1: Apply

 public void Apply(ITfsWorkspace workspace)
 {
     workspace.Edit(_path);
     workspace.Rename(_path, _pathTo);
     var workspaceFile = workspace.GetLocalPath(_pathTo);
     _repository.GetBlob(_newSha, workspaceFile);
 }
开发者ID:jsmale,项目名称:git-tfs,代码行数:7,代码来源:RenameEdit.cs

示例2: CopyTree

        public LogEntry CopyTree(GitIndexInfo index, ITfsWorkspace workspace)
        {
            var startTime = DateTime.Now;
            var itemsCopied = 0;
            var maxChangesetId = 0;
            var tfsTreeEntries = GetTree().ToArray();
            if (tfsTreeEntries.Length == 0)
            {
                maxChangesetId = _changeset.ChangesetId;
            }
            else
            {
                workspace.Get(_changeset.ChangesetId);
                foreach (var entry in tfsTreeEntries)
                {
                    Add(entry.Item, entry.FullName, index, workspace);
                    maxChangesetId = Math.Max(maxChangesetId, entry.Item.ChangesetId);

                    itemsCopied++;
                    if (DateTime.Now - startTime > TimeSpan.FromSeconds(30))
                    {
                        _stdout.WriteLine("{0} objects created...", itemsCopied);
                        startTime = DateTime.Now;
                    }
                }
            }
            return MakeNewLogEntry(maxChangesetId == _changeset.ChangesetId ? _changeset : _tfs.GetChangeset(maxChangesetId));
        }
开发者ID:JamesDunne,项目名称:git-tfs,代码行数:28,代码来源:TfsChangeset.cs

示例3: Apply

 public void Apply(ITfsWorkspace workspace)
 {
     workspace.Edit(Path);
     workspace.Rename(Path, PathTo, Score);
     var workspaceFile = workspace.GetLocalPath(PathTo);
     _repository.GetBlob(NewSha, workspaceFile);
 }
开发者ID:hammerdr,项目名称:git-tfs,代码行数:7,代码来源:RenameEdit.cs

示例4: Apply

 public LogEntry Apply(string lastCommit, GitIndexInfo index, ITfsWorkspace workspace)
 {
     var initialTree = Summary.Remote.Repository.GetObjects(lastCommit);
     workspace.Get(_changeset);
     foreach (var change in Sort(_changeset.Changes))
     {
         Apply(change, index, workspace, initialTree);
     }
     return MakeNewLogEntry();
 }
开发者ID:runt18,项目名称:git-tfs,代码行数:10,代码来源:TfsChangeset.cs

示例5: Rename

 private void Rename(IChange change, string pathInGitRepo, GitIndexInfo index, ITfsWorkspace workspace, IDictionary<string, GitObject> initialTree)
 {
     var oldPath = GetPathInGitRepo(GetPathBeforeRename(change.Item), initialTree);
     if (oldPath != null)
     {
         Delete(oldPath, index, initialTree);
     }
     if (!change.ChangeType.IncludesOneOf(TfsChangeType.Delete))
     {
         Update(change, pathInGitRepo, index, workspace, initialTree);
     }
 }
开发者ID:runt18,项目名称:git-tfs,代码行数:12,代码来源:TfsChangeset.cs

示例6: Apply

 public LogEntry Apply(string lastCommit, IGitTreeModifier treeBuilder, ITfsWorkspace workspace)
 {
     var initialTree = Summary.Remote.Repository.GetObjects(lastCommit);
     var resolver = new PathResolver(Summary.Remote, initialTree);
     var sieve = new ChangeSieve(_changeset, resolver);
     workspace.Get(_changeset.ChangesetId, sieve.GetChangesToFetch());
     foreach (var change in sieve.GetChangesToApply())
     {
         Apply(change, treeBuilder, workspace, initialTree);
     }
     return MakeNewLogEntry();
 }
开发者ID:davidalpert,项目名称:git-tfs,代码行数:12,代码来源:TfsChangeset.cs

示例7: Update

 private void Update(ApplicableChange change, IGitTreeModifier treeBuilder, ITfsWorkspace workspace, IDictionary<string, GitObject> initialTree)
 {
     var localPath = workspace.GetLocalPath(change.GitPath);
     if (File.Exists(localPath))
     {
         treeBuilder.Add(change.GitPath, localPath, change.Mode);
     }
     else
     {
         _stdout.WriteLine("Cannot checkout file '{0}' from TFS. Skip it", change.GitPath);
     }
 }
开发者ID:Galilyou,项目名称:git-tfs,代码行数:12,代码来源:TfsChangeset.cs

示例8: Apply

 private void Apply(ApplicableChange change, IGitTreeModifier treeBuilder, ITfsWorkspace workspace, IDictionary<string, GitObject> initialTree)
 {
     switch (change.Type)
     {
         case ChangeType.Update:
             Update(change, treeBuilder, workspace, initialTree);
             break;
         case ChangeType.Delete:
             Delete(change.GitPath, treeBuilder, initialTree);
             break;
         default:
             throw new NotImplementedException("Unsupported change type: " + change.Type);
     }
 }
开发者ID:Galilyou,项目名称:git-tfs,代码行数:14,代码来源:TfsChangeset.cs

示例9: Apply

 public LogEntry Apply(string lastCommit, IGitTreeModifier treeBuilder, ITfsWorkspace workspace, IDictionary<string, GitObject> initialTree, Action<Exception> ignorableErrorHandler)
 {
     if (initialTree.Empty())
         Summary.Remote.Repository.GetObjects(lastCommit, initialTree);
     var resolver = new PathResolver(Summary.Remote, initialTree);
     var sieve = new ChangeSieve(_changeset, resolver);
     _changeset.Get(workspace, sieve.GetChangesToFetch(), ignorableErrorHandler);
     foreach (var change in sieve.GetChangesToApply())
     {
         ignorableErrorHandler.Catch(() => {
             Apply(change, treeBuilder, workspace, initialTree);
         });
     }
     return MakeNewLogEntry();
 }
开发者ID:JenasysDesign,项目名称:git-tfs,代码行数:15,代码来源:TfsChangeset.cs

示例10: Apply

 public LogEntry Apply(string lastCommit, IGitTreeModifier treeBuilder, ITfsWorkspace workspace, IDictionary<string, GitObject> initialTree, Action<Exception> ignorableErrorHandler)
 {
     if (initialTree.Empty())
         Summary.Remote.Repository.GetObjects(lastCommit, initialTree);
     var remoteRelativeLocalPath = GetPathRelativeToWorkspaceLocalPath(workspace);
     var resolver = new PathResolver(Summary.Remote, remoteRelativeLocalPath, initialTree);
     var sieve = new ChangeSieve(_changeset, resolver);
     if (sieve.RenameBranchCommmit)
     {
         IsRenameChangeset = true;
     }
     _changeset.Get(workspace, sieve.GetChangesToFetch(), ignorableErrorHandler);
     var forceGetChanges = lastCommit == null;
     foreach (var change in sieve.GetChangesToApply(forceGetChanges))
     {
         ignorableErrorHandler.Catch(() =>
         {
             Apply(change, treeBuilder, workspace, initialTree);
         });
     }
     return MakeNewLogEntry();
 }
开发者ID:pmiossec,项目名称:git-tfs,代码行数:22,代码来源:TfsChangeset.cs

示例11: Checkin

 private int Checkin(string head, string parent, ITfsWorkspace workspace, CheckinOptions options, string sourceTfsPath)
 {
     PendChangesToWorkspace(head, parent, workspace);
     if (!string.IsNullOrWhiteSpace(sourceTfsPath))
         workspace.Merge(sourceTfsPath, TfsRepositoryPath);
     return workspace.Checkin(options);
 }
开发者ID:huylu,项目名称:git-tfs,代码行数:7,代码来源:GitTfsRemote.cs

示例12: Get

 public void Get(ITfsWorkspace workspace, IEnumerable<IChange> changes)
 {
     workspace.Get(this.ChangesetId, changes);
 }
开发者ID:ThomasWDonnelly,项目名称:git-tfs,代码行数:4,代码来源:TfsHelper.VsFake.cs

示例13: Add

 private void Add(IItem item, string pathInGitRepo, GitIndexInfo index, ITfsWorkspace workspace)
 {
     if (item.DeletionId == 0)
     {
         index.Update(Mode.NewFile, pathInGitRepo, workspace.GetLocalPath(pathInGitRepo));
     }
 }
开发者ID:runt18,项目名称:git-tfs,代码行数:7,代码来源:TfsChangeset.cs

示例14: Checkin

 private long Checkin(string head, TfsChangesetInfo parentChangeset, ITfsWorkspace workspace)
 {
     foreach (var change in Repository.GetChangedFiles(parentChangeset.GitCommit, head))
     {
         change.Apply(workspace);
     }
     return workspace.Checkin();
 }
开发者ID:chrisortman,项目名称:git-tfs,代码行数:8,代码来源:GitTfsRemote.cs

示例15: PendChangesToWorkspace

 private void PendChangesToWorkspace(string head, string parent, ITfsWorkspace workspace)
 {
     foreach (var change in Repository.GetChangedFiles(parent, head))
     {
         change.Apply(workspace);
     }
 }
开发者ID:roend83,项目名称:git-tfs,代码行数:7,代码来源:GitTfsRemote.cs


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