CompareFiles() private method

private CompareFiles ( string guids, CompareInfo selection ) : bool
guids string
selection CompareInfo
return bool
Exemplo n.º 1
0
        private bool DoShowDiff(bool binary)
        {
            List <string>      list  = new List <string>();
            List <CompareInfo> list2 = new List <CompareInfo>();
            int changeset            = -1;
            int num2 = -1;

            if (AssetServer.IsItemDeleted(this.selectedGUID))
            {
                changeset = -2;
            }
            else
            {
                changeset = AssetServer.GetWorkingItemChangeset(this.selectedGUID);
                changeset = AssetServer.GetServerItemChangeset(this.selectedGUID, changeset);
            }
            int serverItemChangeset = AssetServer.GetServerItemChangeset(this.selectedGUID, -1);

            num2 = (serverItemChangeset != -1) ? serverItemChangeset : -2;
            list.Add(this.selectedGUID);
            list2.Add(new CompareInfo(changeset, num2, !binary ? 0 : 1, !binary ? 1 : 0));
            if (list.Count != 0)
            {
                AssetServer.CompareFiles(list.ToArray(), list2.ToArray());
            }
            else
            {
                return(false);
            }
            return(true);
        }
Exemplo n.º 2
0
        private bool DoShowDiff(bool binary)
        {
            List <string>      list  = new List <string>();
            List <CompareInfo> list2 = new List <CompareInfo>();

            for (int i = 0; i < this.selectedLV1Items.Length; i++)
            {
                if (this.selectedLV1Items[i])
                {
                    int serverItemChangeset = AssetServer.GetServerItemChangeset(this.downloadConflicts[i], -1);
                    int ver = (!AssetServer.HasDeletionConflict(this.downloadConflicts[i])) ? -1 : -2;
                    list.Add(this.downloadConflicts[i]);
                    list2.Add(new CompareInfo(serverItemChangeset, ver, (!binary) ? 0 : 1, (!binary) ? 1 : 0));
                }
            }
            bool result;

            if (list.Count != 0)
            {
                AssetServer.CompareFiles(list.ToArray(), list2.ToArray());
                result = true;
            }
            else
            {
                result = false;
            }
            return(result);
        }
Exemplo n.º 3
0
        private bool DoShowDiff(bool binary)
        {
            List <string>      list  = new List <string>();
            List <CompareInfo> list2 = new List <CompareInfo>();
            int num;

            if (AssetServer.IsItemDeleted(this.selectedGUID))
            {
                num = -2;
            }
            else
            {
                num = AssetServer.GetWorkingItemChangeset(this.selectedGUID);
                num = AssetServer.GetServerItemChangeset(this.selectedGUID, num);
            }
            int serverItemChangeset = AssetServer.GetServerItemChangeset(this.selectedGUID, -1);
            int ver = (serverItemChangeset != -1) ? serverItemChangeset : -2;

            list.Add(this.selectedGUID);
            list2.Add(new CompareInfo(num, ver, (!binary) ? 0 : 1, (!binary) ? 1 : 0));
            bool result;

            if (list.Count != 0)
            {
                AssetServer.CompareFiles(list.ToArray(), list2.ToArray());
                result = true;
            }
            else
            {
                result = false;
            }
            return(result);
        }
Exemplo n.º 4
0
        private void DoShowDiff(string guid)
        {
            List <string>      list  = new List <string>();
            List <CompareInfo> list2 = new List <CompareInfo>();
            int workingItemChangeset = AssetServer.GetWorkingItemChangeset(guid);

            list.Add(guid);
            list2.Add(new CompareInfo(workingItemChangeset, -1, 0, 1));
            Debug.Log("Comparing asset revisions " + workingItemChangeset.ToString() + " and Local");
            AssetServer.CompareFiles(list.ToArray(), list2.ToArray());
        }
Exemplo n.º 5
0
        private void DoShowDiff(bool binary, int ver1, int ver2)
        {
            List <string>      list  = new List <string>();
            List <CompareInfo> list2 = new List <CompareInfo>();

            if ((ver2 == -1) && (AssetDatabase.GUIDToAssetPath(this.m_ChangeLogSelectionGUID) == string.Empty))
            {
                Debug.Log("Cannot compare asset " + this.m_ChangeLogSelectionAssetName + " to local version because it does not exists.");
            }
            else
            {
                list.Add(this.m_ChangeLogSelectionGUID);
                list2.Add(new CompareInfo(ver1, ver2, !binary ? 0 : 1, !binary ? 1 : 0));
                Debug.Log("Comparing asset " + this.m_ChangeLogSelectionAssetName + " revisions " + ver1.ToString() + " and " + ((ver2 != -1) ? ver2.ToString() : "Local"));
                AssetServer.CompareFiles(list.ToArray(), list2.ToArray());
            }
        }
Exemplo n.º 6
0
        private bool DoShowDiff(bool binary)
        {
            List <string>      stringList      = new List <string>();
            List <CompareInfo> compareInfoList = new List <CompareInfo>();
            int ver1 = !AssetServer.IsItemDeleted(this.selectedGUID) ? AssetServer.GetServerItemChangeset(this.selectedGUID, AssetServer.GetWorkingItemChangeset(this.selectedGUID)) : -2;
            int serverItemChangeset = AssetServer.GetServerItemChangeset(this.selectedGUID, -1);
            int ver2 = serverItemChangeset != -1 ? serverItemChangeset : -2;

            stringList.Add(this.selectedGUID);
            compareInfoList.Add(new CompareInfo(ver1, ver2, !binary ? 0 : 1, !binary ? 1 : 0));
            if (stringList.Count == 0)
            {
                return(false);
            }
            AssetServer.CompareFiles(stringList.ToArray(), compareInfoList.ToArray());
            return(true);
        }
        private bool DoShowDiff(bool binary)
        {
            List <string>      stringList      = new List <string>();
            List <CompareInfo> compareInfoList = new List <CompareInfo>();

            for (int index = 0; index < this.selectedLV1Items.Length; ++index)
            {
                if (this.selectedLV1Items[index])
                {
                    int serverItemChangeset = AssetServer.GetServerItemChangeset(this.downloadConflicts[index], -1);
                    int ver2 = !AssetServer.HasDeletionConflict(this.downloadConflicts[index]) ? -1 : -2;
                    stringList.Add(this.downloadConflicts[index]);
                    compareInfoList.Add(new CompareInfo(serverItemChangeset, ver2, !binary ? 0 : 1, !binary ? 1 : 0));
                }
            }
            if (stringList.Count == 0)
            {
                return(false);
            }
            AssetServer.CompareFiles(stringList.ToArray(), compareInfoList.ToArray());
            return(true);
        }
Exemplo n.º 8
0
        private void DoShowDiff(bool binary, int ver1, int ver2)
        {
            List <string>      list  = new List <string>();
            List <CompareInfo> list2 = new List <CompareInfo>();

            if (ver2 == -1 && AssetDatabase.GUIDToAssetPath(this.m_ChangeLogSelectionGUID) == string.Empty)
            {
                Debug.Log("Cannot compare asset " + this.m_ChangeLogSelectionAssetName + " to local version because it does not exists.");
                return;
            }
            list.Add(this.m_ChangeLogSelectionGUID);
            list2.Add(new CompareInfo(ver1, ver2, (!binary) ? 0 : 1, (!binary) ? 1 : 0));
            Debug.Log(string.Concat(new string[]
            {
                "Comparing asset ",
                this.m_ChangeLogSelectionAssetName,
                " revisions ",
                ver1.ToString(),
                " and ",
                (ver2 != -1) ? ver2.ToString() : "Local"
            }));
            AssetServer.CompareFiles(list.ToArray(), list2.ToArray());
        }