本文整理汇总了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);
}
示例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));
}
示例3: Apply
public void Apply(ITfsWorkspace workspace)
{
workspace.Edit(Path);
workspace.Rename(Path, PathTo, Score);
var workspaceFile = workspace.GetLocalPath(PathTo);
_repository.GetBlob(NewSha, workspaceFile);
}
示例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();
}
示例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);
}
}
示例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();
}
示例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);
}
}
示例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);
}
}
示例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();
}
示例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();
}
示例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);
}
示例12: Get
public void Get(ITfsWorkspace workspace, IEnumerable<IChange> changes)
{
workspace.Get(this.ChangesetId, changes);
}
示例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));
}
}
示例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();
}
示例15: PendChangesToWorkspace
private void PendChangesToWorkspace(string head, string parent, ITfsWorkspace workspace)
{
foreach (var change in Repository.GetChangedFiles(parent, head))
{
change.Apply(workspace);
}
}