Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
U
Unity
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Shane Veasy
Unity
Commits
2544a0f6
Commit
2544a0f6
authored
7 years ago
by
Stanley Goldman
Browse files
Options
Downloads
Patches
Plain Diff
Stopping ProjectWindowInterface from tracking ignored entries and entries outside of Assets
Adding some logging
parent
b213b23a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/UnityExtension/Assets/Editor/GitHub.Unity/UI/ProjectWindowInterface.cs
+53
-8
53 additions, 8 deletions
...n/Assets/Editor/GitHub.Unity/UI/ProjectWindowInterface.cs
with
53 additions
and
8 deletions
src/UnityExtension/Assets/Editor/GitHub.Unity/UI/ProjectWindowInterface.cs
+
53
−
8
View file @
2544a0f6
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading.Tasks
;
...
...
@@ -16,8 +17,8 @@ namespace GitHub.Unity
private
static
bool
initialized
=
false
;
private
static
IRepository
repository
;
private
static
bool
isBusy
=
false
;
private
static
ILogging
logger
=
Logging
.
GetLogger
<
ProjectWindowInterface
>()
;
private
static
ILogging
Logger
{
get
{
return
logger
;
}
}
private
static
ILogging
logger
;
private
static
ILogging
Logger
{
get
{
return
logger
=
logger
??
Logging
.
GetLogger
<
ProjectWindowInterface
>()
;
}
}
public
static
void
Initialize
(
IRepository
repo
)
{
...
...
@@ -156,6 +157,8 @@ namespace GitHub.Unity
return
;
}
locks
=
update
.
ToList
();
Logger
.
Trace
(
"Clearing Lock guids"
);
guidsLocks
.
Clear
();
foreach
(
var
lck
in
locks
)
{
...
...
@@ -165,8 +168,13 @@ namespace GitHub.Unity
var
g
=
AssetDatabase
.
AssetPathToGUID
(
assetPath
);
if
(!
guidsLocks
.
Contains
(
g
))
{
Logger
.
Trace
(
"Tracking Lock Path:{0}, Guid: {1}, LockId: {2}, LockUser: {3}"
,
assetPath
,
g
,
lck
.
ID
,
lck
.
User
);
guidsLocks
.
Add
(
g
);
}
else
{
Logger
.
Warning
(
"Error Tracking Lock Path:{0}, Guid: {1}, LockId: {2}, LockUser: {3}"
,
assetPath
,
g
,
lck
.
ID
,
lck
.
User
);
}
}
}
...
...
@@ -185,14 +193,38 @@ namespace GitHub.Unity
entries
.
Clear
();
entries
.
AddRange
(
update
.
Entries
);
Logger
.
Trace
(
"Clearing Entry guids"
);
guids
.
Clear
();
for
(
var
index
=
0
;
index
<
entries
.
Count
;
++
index
)
{
var
path
=
entries
[
index
].
ProjectPath
;
var
g
=
string
.
IsNullOrEmpty
(
path
)
?
string
.
Empty
:
AssetDatabase
.
AssetPathToGUID
(
path
);
if
(!
guids
.
Contains
(
g
))
var
gitStatusEntry
=
entries
[
index
];
var
path
=
gitStatusEntry
.
ProjectPath
;
if
(
gitStatusEntry
.
Status
==
GitFileStatus
.
Ignored
)
{
continue
;
}
if
(!
path
.
StartsWith
(
"Assets"
,
StringComparison
.
CurrentCultureIgnoreCase
))
{
continue
;
}
if
(
path
.
EndsWith
(
".meta"
,
StringComparison
.
CurrentCultureIgnoreCase
))
{
continue
;
}
var
guid
=
AssetDatabase
.
AssetPathToGUID
(
path
);
if
(!
guids
.
Contains
(
guid
))
{
guids
.
Add
(
g
);
Logger
.
Trace
(
"Tracking Entry Path:{0}, Guid: {1}, Status: {2}"
,
path
,
guid
,
gitStatusEntry
.
Status
);
guids
.
Add
(
guid
);
}
else
{
Logger
.
Warning
(
"Error Entry Path:{0}, Guid: {1}, Status: {2}"
,
path
,
guid
,
gitStatusEntry
.
Status
);
}
}
...
...
@@ -206,6 +238,8 @@ namespace GitHub.Unity
return
;
}
var
guidToAssetPath
=
AssetDatabase
.
GUIDToAssetPath
(
guid
);
var
index
=
guids
.
IndexOf
(
guid
);
var
indexLock
=
guidsLocks
.
IndexOf
(
guid
);
...
...
@@ -214,13 +248,24 @@ namespace GitHub.Unity
return
;
}
var
status
=
index
>=
0
?
entries
[
index
].
Status
:
GitFileStatus
.
None
;
GitStatusEntry
?
gitStatusEntry
;
gitStatusEntry
=
entries
[
index
];
GitFileStatus
status
;
if
(
index
>=
0
)
{
gitStatusEntry
=
entries
[
index
];
status
=
gitStatusEntry
.
Value
.
Status
;
}
else
{
status
=
GitFileStatus
.
None
;
}
var
isLocked
=
indexLock
>=
0
;
var
texture
=
Styles
.
GetFileStatusIcon
(
status
,
isLocked
);
if
(
texture
==
null
)
{
l
ogger
.
Warning
(
"Unable to retrieve texture for Status: {
0
} IsLocked:{
1
}"
,
status
,
isLocked
);
L
ogger
.
Warning
(
"Unable to retrieve texture for
Guid:{0} EntryPath:{1} DatabasePath:{2}
Status: {
3
} IsLocked:{
4
}"
,
guid
,
gitStatusEntry
.
HasValue
?
gitStatusEntry
.
Value
.
Path
:
string
.
Empty
,
guidToAssetPath
,
status
.
ToString
()
,
isLocked
);
return
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment