Example #1
0
        public void PendDelete(ILocalPath path)
        {
            var serverPath = _workspace.GetServerItemForLocalItem(path.AsString());

            _workspace.Get(new GetRequest(serverPath, RecursionType.Full, VersionSpec.Latest), GetOptions.None);
            _workspace.PendDelete(path.AsString(), RecursionType.Full);
            _pendingChanges.Add(path.AsString());
        }
Example #2
0
        public LogEntry CopyTree(IGitTreeModifier treeBuilder, 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, treeBuilder, workspace);
                    maxChangesetId = Math.Max(maxChangesetId, entry.Item.ChangesetId);

                    itemsCopied++;
                    if (DateTime.Now - startTime > TimeSpan.FromSeconds(30))
                    {
                        Trace.TraceInformation("{0} objects created...", itemsCopied);
                        startTime = DateTime.Now;
                    }
                }
            }
            return(MakeNewLogEntry(maxChangesetId == _changeset.ChangesetId ? _changeset : _tfs.GetChangeset(maxChangesetId)));
        }
Example #3
0
        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));
        }
Example #4
0
 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();
 }
Example #5
0
        public LogEntry Apply(string lastCommit, GitIndexInfo index, ITfsWorkspace workspace)
        {
            var initialTree = workspace.Remote.Repository.GetObjects(lastCommit);

            workspace.Get(_changeset);
            foreach (var change in Sort(_changeset.Changes))
            {
                Apply(change, index, workspace, initialTree);
            }
            return(MakeNewLogEntry());
        }
Example #6
0
 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();
 }
Example #7
0
        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());
        }
Example #8
0
        public LogEntry CopyTree(IGitTreeModifier treeBuilder, 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)
                {
                    var tfsPath = entry.FullName;
                    if (!string.IsNullOrEmpty(Summary.Remote.TfsRepositoryPath) && entry.Item.ServerItem.StartsWith(Summary.Remote.TfsRepositoryPath))
                    {
                        tfsPath = entry.Item.ServerItem.Substring(Summary.Remote.TfsRepositoryPath.Length);
                    }
                    while (tfsPath.StartsWith("/"))
                    {
                        tfsPath = tfsPath.Substring(1);
                    }
                    Add(entry.Item, entry.FullName, tfsPath, treeBuilder, workspace);
                    maxChangesetId = Math.Max(maxChangesetId, entry.Item.ChangesetId);

                    itemsCopied++;
                    if (DateTime.Now - startTime > TimeSpan.FromSeconds(30))
                    {
                        Trace.TraceInformation("{0} objects created...", itemsCopied);
                        startTime = DateTime.Now;
                    }
                }
            }
            return(MakeNewLogEntry(maxChangesetId == _changeset.ChangesetId ? _changeset : _tfs.GetChangeset(maxChangesetId)));
        }
Example #9
0
 public void Get(ITfsWorkspace workspace, IEnumerable <IChange> changes)
 {
     workspace.Get(this.ChangesetId, changes);
 }
Example #10
0
 public void Get(ITfsWorkspace workspace, IEnumerable<IChange> changes, Action<Exception> ignorableErrorHandler)
 {
     workspace.Get(this.ChangesetId, changes);
 }
Example #11
0
 public void Get(ITfsWorkspace workspace, IEnumerable <IChange> changes, Action <Exception> ignorableErrorHandler)
 {
     workspace.Get(this.ChangesetId, changes);
 }
 public void Get(ITfsWorkspace workspace, IEnumerable<IChange> changes)
 {
     workspace.Get(this.ChangesetId, changes);
 }