示例#1
0
 TestFileResult BeforeCheckOutModifyFile(string vcsPath, string localPath, bool ignoreSharedFiles, bool singleSharedFile, TrackBranch branch, TrackItem item)
 {
     if (!PerformHasFileTestBeforeCheckout(vcsPath))
     {
         Log.Error($"Check modify capability. File {vcsPath} is not found in vcs.");
         return(TestFileResult.Fail);
     }
     return(PerformSimpleTestBeforeCheckout(vcsPath, ignoreSharedFiles, singleSharedFile, true));
 }
示例#2
0
        public IList <TrackItem> GenerateTrackItems(TrackBranch trackBranch, TrackItem trackItem)
        {
            if (!trackItem.GoDeeper)
            {
                return new List <TrackItem>()
                       {
                           trackItem
                       }
            }
            ;
            try {
                var repo = DXVcsConnectionHelper.Connect(server, user, password);

                string trackRoot   = trackBranch.GetTrackRoot(trackItem);
                var    projectData = repo.GetProjectData(trackRoot);
                if (projectData.IsNull || projectData.SubProjectsCount == 0)
                {
                    return new List <TrackItem>()
                           {
                               trackItem
                           }
                }
                ;
                var innerProjects = repo.GetProjects(trackRoot);
                if (innerProjects == null || innerProjects.Length == 0)
                {
                    return new List <TrackItem>()
                           {
                               trackItem
                           }
                }
                ;

                List <TrackItem> result = new List <TrackItem>(innerProjects.Length);
                foreach (var info in innerProjects)
                {
                    var newTrackItem = new TrackItem();

                    newTrackItem.Branch           = trackBranch;
                    newTrackItem.GoDeeper         = false;
                    newTrackItem.Force            = trackItem.Force;
                    newTrackItem.Path             = trackItem.Path + @"/" + info.Name;
                    newTrackItem.ProjectPath      = Path.Combine(trackItem.ProjectPath, info.Name).Replace(@"\", @"/");
                    newTrackItem.AdditionalOffset = trackItem.AdditionalOffset;
                    result.Add(newTrackItem);
                }

                var files = repo.GetFilesData(trackRoot);
                foreach (var info in files)
                {
                    var newTrackItem = new TrackItem();
                    newTrackItem.Branch           = trackBranch;
                    newTrackItem.GoDeeper         = false;
                    newTrackItem.IsFile           = true;
                    newTrackItem.Force            = trackItem.Force;
                    newTrackItem.Path             = trackItem.Path + @"/" + info.Name;
                    newTrackItem.ProjectPath      = Path.Combine(trackItem.ProjectPath, info.Name).Replace(@"\", @"/");
                    newTrackItem.AdditionalOffset = trackItem.AdditionalOffset;
                    result.Add(newTrackItem);
                }
                return(result);
            }
            catch (Exception ex) {
                Log.Error("Generating trackitems from config failed", ex);
                throw ex;
            }
        }
示例#3
0
        public bool ProcessCheckout(IEnumerable <SyncItem> items, bool ignoreSharedFiles, TrackBranch branch)
        {
            var list        = items.ToList();
            var sharedFiles = list.Where(item => IsSharedFile(item.VcsPath)).ToList();

            sharedFiles.ForEach(x => CheckIsSingleSharedFile(list, x));

            list.ForEach(x => {
                TestFileResult result = ProcessBeforeCheckout(x, ignoreSharedFiles, branch, x.Track, x.NewTrack);
                x.State = CalcBeforeCheckoutState(result);
            });

            if (list.Any(x => x.State == ProcessState.Failed))
            {
                return(false);
            }

            list.ForEach(x => {
                TestFileResult result = ProcessCheckoutItem(x, x.Comment.ToString());
                x.State = CalcCheckoutStateAfterCheckout(result);
            });
            return(list.All(x => x.State == ProcessState.Modified || x.State == ProcessState.Ignored));
        }
示例#4
0
        TestFileResult BeforeCheckOutMoveFile(string vcsPath, string newVcsPath, string localPath, string newLocalPath, bool ignoreSharedFiles, TrackBranch branch, TrackItem trackItem, TrackItem newTrackItem, ref SyncAction newAction)
        {
            if (trackItem.IsFile)
            {
                Log.Error($"Moving individually synchronized files is forbidden. Remove {trackItem.ProjectPath} from track config first or do it usimg vcs.");
                return(TestFileResult.Fail);
            }

            bool isOldPathTracking = branch.IsTrackingVcsPath(vcsPath);
            bool isNewPathTracking = branch.IsTrackingVcsPath(newVcsPath);

            if (isOldPathTracking && !PerformHasFileTestBeforeCheckout(vcsPath))
            {
                Log.Error($"Check move capability. Source file {vcsPath} is not found in vcs.");
                return(TestFileResult.Fail);
            }
            if (isNewPathTracking && PerformHasFileTestBeforeCheckout(newVcsPath))
            {
                Log.Error($"Check move capability. Target file {newVcsPath} is found in vcs.");
                return(TestFileResult.Fail);
            }

            if (!isNewPathTracking && !isOldPathTracking)
            {
                return(TestFileResult.Ignore);
            }
            if (isNewPathTracking && !isOldPathTracking)
            {
                newAction = SyncAction.New;
                return(BeforeCheckOutCreateFile(newVcsPath, localPath, ignoreSharedFiles, trackItem));
            }
            else if (!isNewPathTracking && isOldPathTracking)
            {
                newAction = SyncAction.Delete;
                return(BeforeCheckOutDeleteFile(vcsPath, localPath, ignoreSharedFiles, trackItem));
            }

            var oldPathResult = PerformSimpleTestBeforeCheckout(vcsPath, ignoreSharedFiles, false, false);

            if (oldPathResult != TestFileResult.Ok)
            {
                return(oldPathResult);
            }
            return(PerformSimpleTestBeforeCheckout(newVcsPath, ignoreSharedFiles, false, false));
        }
示例#5
0
 public Token EvaluateAt(TrackBranch firstBranch, float trackPos, float trasversal, int mask, SBSVector3 pos, SBSVector3 tang)
示例#6
0
    public List <TokenHit> GetTokens(Vector3 worldPos, Token startToken, TrackBranch trackBranch, bool exitAtFirstHit, int branchMask)
    {
        if (null == startToken)
        {
            if (null == trackBranch)
            {
                LevelObject[] objs = LevelRoot.Instance.Query(new Bounds(worldPos, Vector3.zero), "tokens");
                if (objs.Length > 0)
                {
                    startToken = objs[0].gameObject.GetComponent <Token>();
                }
                else
                {
                    objs = LevelRoot.Instance.Query("tokens");
                    if (objs.Length > 0)
                    {
                        startToken = objs[0].gameObject.GetComponent <Token>();
                    }
                    else
                    {
                        return(new List <TokenHit>());
                    }
                }
            }
            else
            {
                startToken = trackBranch[0];
            }
        }

        if (null == lastCrossHit)
        {
            lastCrossHit = startToken;
        }
        else
        {
            startToken = lastCrossHit;
        }

        List <TokenHit> tokenHits     = new List <TokenHit>();
        List <int>      visitedTokens = new List <int>();

#if UNITY_FLASH
        List <Token> queue = new List <Token>();
        queue.Add(startToken);
#else
        Queue <Token> queue = new Queue <Token>();
        queue.Enqueue(startToken);
#endif

        visitedTokens.Add(startToken.UniqueId);

        while (queue.Count > 0)
        {
            TokenHit tokenHit = new TokenHit();

#if UNITY_FLASH
            tokenHit.token = queue[0];
            queue.RemoveAt(0);
#else
            tokenHit.token = queue.Dequeue();
#endif
            tokenHit.token.WorldToToken(worldPos, out tokenHit.longitudinal, out tokenHit.trasversal);

            if (tokenHit.longitudinal >= 0.0f - longitudinalExt &&
                tokenHit.longitudinal <= 1.0f + longitudinalExt &&
                tokenHit.trasversal >= -1.0f - trasversalExt &&
                tokenHit.trasversal <= 1.0f + trasversalExt &&
                (tokenHit.token.TrackBranch == trackBranch || null == trackBranch) &&
                (null == tokenHit.token.TrackBranch || (tokenHit.token.TrackBranch.mask & branchMask) != 0))
            {
#if UNITY_FLASH
                tokenHit.token.TokenToWorld(tokenHit.longitudinal, tokenHit.trasversal, tokenHit.position, tokenHit.tangent);
#else
                tokenHit.token.TokenToWorld(tokenHit.longitudinal, tokenHit.trasversal, out tokenHit.position, out tokenHit.tangent);
#endif
                tokenHits.Add(tokenHit);

                if (tokenHit.token.type == Token.TokenType.Cross)
                {
                    lastCrossHit = tokenHit.token;
                }

                if (exitAtFirstHit)
                {
                    break;
                }
            }

            if (isGrid)
            {
                foreach (Token link in tokenHit.token.links)
                {
                    if (null != link)
                    {
                        int linkIndex = visitedTokens.BinarySearch(link.UniqueId);
                        if (linkIndex < 0)
                        {
                            queue.Enqueue(link);
                            visitedTokens.Insert(~linkIndex, link.UniqueId);
                        }
                    }
                }
            }
            else
            {
                foreach (Token link in tokenHit.token.nextLinks)
                {
#if UNITY_FLASH
                    int linkIndex = AS3Utils.BinarySearchList(visitedTokens, link.UniqueId);
#else
                    int linkIndex = visitedTokens.BinarySearch(link.UniqueId);
#endif

                    if (linkIndex < 0)
                    {
#if UNITY_FLASH
                        queue.Add(link);
#else
                        queue.Enqueue(link);
#endif

                        visitedTokens.Insert(~linkIndex, link.UniqueId);
                    }
                }

                foreach (Token link in tokenHit.token.prevLinks)
                {
#if UNITY_FLASH
                    int linkIndex = AS3Utils.BinarySearchList(visitedTokens, link.UniqueId);
#else
                    int linkIndex = visitedTokens.BinarySearch(link.UniqueId);
#endif

                    if (linkIndex < 0)
                    {
#if UNITY_FLASH
                        queue.Add(link);
#else
                        queue.Enqueue(link);
#endif

                        visitedTokens.Insert(~linkIndex, link.UniqueId);
                    }
                }
            }
        }

        return(tokenHits);//.ToArray(); ToDo Flash
    }
示例#7
0
    public void Build()
    {
        int count = startTransforms.Length;

        startTokens  = new Token[count];
        startOffsets = new float[count];
        rootBranches = new TrackBranch[count];

        TokensManager.TokenHit[] hits = new TokensManager.TokenHit[count];
        for (int i = 0; i < count; ++i)
        {
            SBSVector3 p = startTransforms[i].position;

            hits[i] = new TokensManager.TokenHit();
            TokensManager.Instance.GetToken(p, out hits[i]);
            Asserts.Assert(hits[i].token != null);

            TrackBranch branch = hits[i].token.TrackBranch;
            startTokens[i]  = hits[i].token;
            rootBranches[i] = branch;
        }
        // ToDo
        foreach (KeyValuePair <TrackBranch, BranchNode> item in branchNodes)
        {
            item.Value.Initialize();
        }
        Stack <TrackBranch> branches        = new Stack <TrackBranch>();
        List <TrackBranch>  visitedBranches = new List <TrackBranch>();

        branches.Push(rootBranches[0]);
        visitedBranches.Add(rootBranches[0]);
        rootBranches[0].startLength = 0.0f;
        while (branches.Count > 0)
        {
            TrackBranch branch = branches.Pop();

            BranchNode node = branchNodes[branch];

            float maxBranchLength = 0.0f;
            foreach (BranchNode nextNode in node.NextLinks)
            {
                maxBranchLength = SBSMath.Max(maxBranchLength, nextNode.Branch.Length);
            }

            foreach (BranchNode nextNode in node.NextLinks)
            {
                if (!branches.Contains(nextNode.Branch) && !visitedBranches.Contains(nextNode.Branch))
                {
                    nextNode.Branch.LengthScale = maxBranchLength / nextNode.Branch.Length;
                    nextNode.Branch.startLength = Mathf.Max(nextNode.Branch.startLength, branch.startLength + branch.Length);
                    visitedBranches.Add(branch);
                    branches.Push(nextNode.Branch);
                }
            }
        }/*
          * foreach (KeyValuePair<TrackBranch, BranchNode> item in branchNodes)
          * Debug.Log(item.Value.Branch.startLength + ", " + item.Value.Branch.Length);
          */
        for (int i = 0; i < count; ++i)
        {
            TrackBranch branch = hits[i].token.TrackBranch;
            startOffsets[i] = (branch.startLength + hits[i].longitudinal * hits[i].token.Length) * branch.LengthScale;
            Debug.Log("startOffsets[" + i + "] = " + startOffsets[i]);
        }

        maxLength = 0.0f;
        foreach (KeyValuePair <TrackBranch, BranchNode> item in branchNodes)
        {
            maxLength = SBSMath.Max(maxLength, item.Key.startLength + item.Key.Length);
        }
        Debug.Log("Track length: " + maxLength);
    }
示例#8
0
 public BranchNode GetNodeFromBranch(TrackBranch branch)
 {
     return(branchNodes[branch]);
 }
示例#9
0
 public void LinkToTrack(TrackBranch _trackBranch, int _trackBranchIndex)
 {
     trackBranch      = _trackBranch;
     trackBranchIndex = _trackBranchIndex;
 }
示例#10
0
 public int CompareTo(TrackBranch other)
 {
     return(startLength.CompareTo(other.startLength));
 }
示例#11
0
        void GenerateWinRTConfig(string branchName)
        {
            List <TrackItem> items = new List <TrackItem>();

            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/WinRT/DevExpress.Core", ProjectPath = "DevExpress.Core"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/WinRT/DevExpress.Drawing", ProjectPath = "DevExpress.Drawing"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/WinRT/DevExpress.Pdf.Core", ProjectPath = "DevExpress.Pdf.Core"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/WinRT/DevExpress.TestFramework", ProjectPath = "DevExpress.TestFramework"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/WinRT/DevExpress.TestRunner", ProjectPath = "DevExpress.TestRunner"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/WinRT/DevExpress.TestsKey", ProjectPath = "DevExpress.TestsKey"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/WinRT/DevExpress.TestUtils", ProjectPath = "DevExpress.TestUtils"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/WinRT/DevExpress.UI.Xaml", ProjectPath = "DevExpress.UI.Xaml"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/WinRT/DevExpress.UI.Xaml.Charts", ProjectPath = "DevExpress.UI.Xaml.Charts"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/WinRT/DevExpress.UI.Xaml.Controls", ProjectPath = "DevExpress.UI.Xaml.Controls"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/WinRT/DevExpress.UI.Xaml.Editors", ProjectPath = "DevExpress.UI.Xaml.Editors"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/WinRT/DevExpress.UI.Xaml.Gauges", ProjectPath = "DevExpress.UI.Xaml.Gauges"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/WinRT/DevExpress.UI.Xaml.Grid", ProjectPath = "DevExpress.UI.Xaml.Grid"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/WinRT/DevExpress.UI.Xaml.Layout", ProjectPath = "DevExpress.UI.Xaml.Layout"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/WinRT/DevExpress.UI.Xaml.Map", ProjectPath = "DevExpress.UI.Xaml.Map"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/WinRT/DevExpress.WinRT.Projects.Installers", ProjectPath = "DevExpress.WinRT.Projects.Installers"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/WinRT/DevExpress.WinRT.Projects.Wizards", ProjectPath = "DevExpress.WinRT.Projects.Wizards"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/WinRT/Shared", ProjectPath = "Shared"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/WinRT/Tools", ProjectPath = "Tools"
            });
            TrackBranch branch = new TrackBranch($"{branchName}", $@"$/{branchName}/UWP.GIT/sync.config", $@"$/{branchName}", items);

            SharpSerializerXmlSettings settings = new SharpSerializerXmlSettings();

            settings.IncludeAssemblyVersionInTypeName = false;
            settings.IncludePublicKeyTokenInTypeName  = false;
            SharpSerializer serializer = new SharpSerializer(settings);

            serializer.Serialize(new List <TrackBranch>()
            {
                branch
            }, $@"z:\trackconfig_uwp_{branchName}.config");
        }
示例#12
0
        void GenerateDataAccessConfig(string branchName)
        {
            List <TrackItem> items = new List <TrackItem>();

            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/Win/DevExpress.DataAccess", ProjectPath = "DevExpress.DataAccess", AdditionalOffset = "Win"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/Tests.DataAccess/BigQueryTests", ProjectPath = "BigQueryTests", AdditionalOffset = "Tests.DataAccess"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/Tests.DataAccess/DataAccessTests", ProjectPath = "DataAccessTests", AdditionalOffset = "Tests.DataAccess"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/Tests.DataAccess/EntityFramework7Tests", ProjectPath = "EntityFramework7Tests", AdditionalOffset = "Tests.DataAccess"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/Tests.DataAccess/MsSqlCEEF7Tests", ProjectPath = "MsSqlCEEF7Tests", AdditionalOffset = "Tests.DataAccess"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/Tests.DataAccess/MsSqlEF5Tests", ProjectPath = "MsSqlEF5Tests", AdditionalOffset = "Tests.DataAccess"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/Tests.DataAccess/MsSqlEF6Tests", ProjectPath = "MsSqlEF6Tests", AdditionalOffset = "Tests.DataAccess"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/Tests.DataAccess/MsSqlEF7Tests", ProjectPath = "MsSqlEF7Tests", AdditionalOffset = "Tests.DataAccess"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/Tests.DataAccess/MySqlEF6Tests", ProjectPath = "MySqlEF6Tests", AdditionalOffset = "Tests.DataAccess"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/Tests.DataAccess/PostgreSqlEF7Tests", ProjectPath = "PostgreSqlEF7Tests", AdditionalOffset = "Tests.DataAccess"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/Tests.DataAccess/PostgreSqlEF7Tests", ProjectPath = "PostgreSqlEF7Tests", AdditionalOffset = "Tests.DataAccess"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/Tests.DataAccess/SqliteEF7Tests", ProjectPath = "SqliteEF7Tests", AdditionalOffset = "Tests.DataAccess"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/Tests.DataAccess/WizardTests", ProjectPath = "WizardTests", AdditionalOffset = "Tests.DataAccess"
            });
            TrackBranch branch = new TrackBranch($"{branchName}", $@"$/{branchName}/DataAccess/sync.config", $@"$/{branchName}", items);

            SharpSerializerXmlSettings settings = new SharpSerializerXmlSettings();

            settings.IncludeAssemblyVersionInTypeName = false;
            settings.IncludePublicKeyTokenInTypeName  = false;
            SharpSerializer serializer = new SharpSerializer(settings);

            serializer.Serialize(new List <TrackBranch>()
            {
                branch
            }, $@"z:\trackconfig_dataaccess_{branchName}.config");
        }
示例#13
0
        void GenerateAspConfig(string branchName)
        {
            List <TrackItem> items = new List <TrackItem>();

            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/ASP/ASPxThemeBuilder", ProjectPath = "ASPxThemeBuilder"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/ASP/ASPxThemeDeployer", ProjectPath = "ASPxThemeDeployer"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/ASP/DevExpress.Web", ProjectPath = "DevExpress.Web"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/ASP/DevExpress.Web.ASPxHtmlEditor", ProjectPath = "DevExpress.Web.ASPxHtmlEditor"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/ASP/DevExpress.Web.ASPxRichEdit", ProjectPath = "DevExpress.Web.ASPxRichEdit"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/ASP/DevExpress.Web.ASPxRichEdit.Tests", ProjectPath = "DevExpress.Web.ASPxRichEdit.Tests"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/ASP/DevExpress.Web.ASPxScheduler", ProjectPath = "DevExpress.Web.ASPxScheduler"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/ASP/DevExpress.Web.ASPxSpellChecker", ProjectPath = "DevExpress.Web.ASPxSpellChecker"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/ASP/DevExpress.Web.ASPxSpreadsheet", ProjectPath = "DevExpress.Web.ASPxSpreadsheet"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/ASP/DevExpress.Web.ASPxThemes", ProjectPath = "DevExpress.Web.ASPxThemes"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/ASP/DevExpress.Web.ASPxTreeList", ProjectPath = "DevExpress.Web.ASPxTreeList"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/ASP/DevExpress.Web.Design", ProjectPath = "DevExpress.Web.Design"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/ASP/DevExpress.Web.Mvc", ProjectPath = "DevExpress.Web.Mvc"
            });
            items.Add(new TrackItem()
            {
                Path = $@"$/{branchName}/ASP/DevExpress.Web.Projects", ProjectPath = "DevExpress.Web.Projects"
            });

            TrackBranch branch = new TrackBranch($"{branchName}", $@"$/{branchName}/Diagram/xpf_common_sync.config", $@"$/{branchName}", items);

            SharpSerializerXmlSettings settings = new SharpSerializerXmlSettings();

            settings.IncludeAssemblyVersionInTypeName = false;
            settings.IncludePublicKeyTokenInTypeName  = false;
            SharpSerializer serializer = new SharpSerializer(settings);

            serializer.Serialize(new List <TrackBranch>()
            {
                branch
            }, $@"z:\trackconfig_asp_{branchName}.config");
        }