/// <summary>
 /// Substitute variables x0 into f.
 /// </summary>
 /// <param name="f"></param>
 /// <param name="x0"></param>
 /// <returns></returns>
 public static Expression Substitute(this Expression f, IDictionary<Expression, Expression> x0, bool IsTransform = false)
 {
     if (x0.Empty())
         return f;
     else
         return new SubstituteVisitor(x0, IsTransform).Visit(f);
 }
        /// <summary>
        /// Substitute variables x0 into f.
        /// </summary>
        /// <param name="f"></param>
        /// <param name="x0"></param>
        /// <returns></returns>
        public static IEnumerable<Expression> Substitute(this IEnumerable<Expression> f, IDictionary<Expression, Expression> x0, bool IsTransform = false)
        {
            if (x0.Empty())
                return f;
            SubstituteVisitor V = new SubstituteVisitor(x0, IsTransform);

            return f.Select(i => V.Visit(i));
        }
Example #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();
 }
Example #4
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 resolver = new PathResolver(Summary.Remote, 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();
 }