示例#1
0
        private void ParseStatusResult(XmlDocument xmlDoc)
        {
            if (!xmlDoc.HasChildNodes)
            {
                return;
            }

            XmlNodeList entries = xmlDoc.GetElementsByTagName("entry");

            //List<XmlNode> metaEntries = new List<XmlNode>();
            foreach (XmlNode entryIt in entries)
            {
                string assetPath = ("Assets/" + entryIt.Attributes["path"].InnerText.Replace('\\', '/')).Trim();
                var    svnStatus = ParseXMLNode(entryIt);
                if (svnStatus.reflectionLevel != ESVNReflectionLevel.None)
                {
                    lock (mSVNStatusDatabaseLock)
                    {
                        mSvnStatusDatabase[assetPath] = svnStatus;
                    }
                }
            }

            XmlNodeList changelists = xmlDoc.GetElementsByTagName("changelist");

            foreach (XmlNode changelistIt in changelists)
            {
                string changelist = changelistIt.Attributes["name"].InnerText;
                foreach (XmlNode entryIt in changelistIt.ChildNodes)
                {
                    string assetPath = ("Assets/" + entryIt.Attributes["path"].InnerText.Replace('\\', '/')).Trim();
                    lock (mSVNStatusDatabaseLock)
                    {
                        if (mSvnStatusDatabase.ContainsKey(assetPath))
                        {
                            mSvnStatusDatabase[assetPath].changelist = changelist;
                            if (changelist == bypassIdentifier)
                            {
                                mSvnStatusDatabase[assetPath].bypassRevisionControl = true;
                            }
                        }
                    }
                }
            }

            foreach (var keyIt in mSvnStatusDatabase.Keys)
            {
                if (mSvnStatusDatabase.GetMetaStatus(keyIt) == null && keyIt != "Assets/.")
                {
                    Debug.LogWarning("Missing Meta: " + keyIt);
                }
            }

            //Debug.Log("SVN Database updated. Number of elements: [" + m_svnStatusMap.Count + "]");
        }
示例#2
0
 public SVNStatus GetAssetStatus(string assetPath)
 {
     if (mStatusDatabase == null || (mStatusDatabase.Count == 0 && !svnBusy))
     {
         UpdateSVNStatus();
     }
     else if (mStatusDatabase.ContainsKey(assetPath))
     {
         return(mStatusDatabase[assetPath]);
     }
     else
     {
         //Debug.Log("Asset not found in SVN database: " + assetPath);
     }
     return(new SVNStatus());
 }