Ejemplo n.º 1
0
        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());
        }
Ejemplo n.º 2
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());
        }
Ejemplo n.º 3
0
        public LogEntry Apply(string lastCommit, IGitTreeModifier treeBuilder, ITfsWorkspace workspace, IDictionary <string, GitObject> initialTree)
        {
            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());
            foreach (var change in sieve.GetChangesToApply())
            {
                Apply(change, treeBuilder, workspace, initialTree);
            }
            return(MakeNewLogEntry());
        }
Ejemplo n.º 4
0
        public LogEntry Apply(string lastCommit, IGitTreeModifier treeBuilder, ITfsWorkspace workspace, IDictionary <string, GitObject> initialTree, Action <Exception> ignorableErrorHandler, FileFilter filters)
        {
            if (initialTree.Empty())
            {
                //add mappings to the resolver
                _mappingsFile.Mappings.ForEach(m =>
                {
                    if (!initialTree.ContainsKey(m.TfsPath))
                    {
                        initialTree.Add(m.TfsPath, new GitObject()
                        {
                            Path = m.LocalPath
                        });
                    }
                });

                Summary.Remote.Repository.GetObjects(lastCommit, initialTree);
            }

            var remoteRelativeLocalPath = GetPathRelativeToWorkspaceLocalPath(workspace);
            var resolver = new PathResolver(Summary.Remote, remoteRelativeLocalPath, initialTree);
            var sieve    = new ChangeSieve(_changeset, resolver, filters);

            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());
        }