示例#1
0
 private static void RunStatusUpdateOnMainThread(GitStatus update)
 {
     new ActionTask(EntryPoint.ApplicationManager.TaskManager.Token, _ => OnStatusUpdate(update))
     {
         Affinity = TaskAffinity.UI
     }.Start();
 }
示例#2
0
 private void RepositoryManagerOnGitStatusUpdated(GitStatus gitStatus)
 {
     taskManager.RunInUI(() =>
     {
         cacheContainer.GitStatusEntriesCache.Entries = gitStatus.Entries;
         cacheContainer.GitTrackingStatusCache.Ahead  = gitStatus.Ahead;
         cacheContainer.GitTrackingStatusCache.Behind = gitStatus.Behind;
     });
 }
 private void Prepare()
 {
     if (gitStatus.Entries == null)
     {
         gitStatus = new GitStatus
         {
             Entries = new List <GitStatusEntry>()
         };
     }
 }
示例#4
0
 public bool Equals(GitStatus other)
 {
     return
         (String.Equals(LocalBranch, other.LocalBranch) &&
          String.Equals(RemoteBranch, other.RemoteBranch) &&
          Ahead == other.Ahead &&
          Behind == other.Behind &&
          object.Equals(Entries, other.Entries)
         );
 }
        private void ReturnStatus()
        {
            if (gitStatus.Entries == null)
            {
                return;
            }

            RaiseOnEntry(gitStatus);

            gitStatus = new GitStatus();
        }
示例#6
0
文件: Repository.cs 项目: lin5/Unity
 private void RepositoryManagerOnGitStatusUpdated(GitStatus gitStatus)
 {
     new ActionTask(CancellationToken.None, () => {
         CurrentChanges = gitStatus.Entries;
         CurrentAhead   = gitStatus.Ahead;
         CurrentBehind  = gitStatus.Behind;
     })
     {
         Affinity = TaskAffinity.UI
     }.Start();
 }
示例#7
0
        private void OnStatusUpdate(GitStatus update)
        {
            if (update.Entries == null)
            {
                //Refresh();
                return;
            }

            // Set branch state
            currentBranch = update.LocalBranch;

            // (Re)build tree
            tree.UpdateEntries(update.Entries.Where(x => x.Status != GitFileStatus.Ignored).ToList());

            busy = false;
        }
示例#8
0
        private static void OnStatusUpdate(GitStatus update)
        {
            if (update.Entries == null)
            {
                return;
            }

            entries.Clear();
            entries.AddRange(update.Entries);

            guids.Clear();
            for (var index = 0; index < entries.Count; ++index)
            {
                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);
                guids.Add(guid);
            }

            EditorApplication.RepaintProjectWindow();
        }
示例#9
0
 private void UpdateStatus(GitStatus status)
 {
     currentRemote = Repository.CurrentRemote.HasValue ? Repository.CurrentRemote.Value.Name : null;
     statusAhead   = status.Ahead;
     statusBehind  = status.Behind;
 }
示例#10
0
 private void UpdateStatusOnMainThread(GitStatus status)
 {
     new ActionTask(TaskManager.Token, _ => UpdateStatus(status))
     .ScheduleUI(TaskManager);
 }
示例#11
0
 private void RepositoryManager_OnStatusUpdated(GitStatus status)
 {
     CurrentStatus = status;
     OnStatusUpdated?.Invoke(CurrentStatus);
 }
示例#12
0
 private void RunStatusUpdateOnMainThread(GitStatus status)
 {
     new ActionTask(TaskManager.Token, _ => OnStatusUpdate(status))
     .ScheduleUI(TaskManager);
 }
示例#13
0
 private void UpdateStatus(GitStatus status)
 {
     statusAhead  = status.Ahead;
     statusBehind = status.Behind;
 }
 private void InternalInvoke(GitStatus status)
 {
     statusUpdated.SafeInvoke(status);
 }
示例#15
0
 private void RepositoryManager_OnRepositoryChanged(GitStatus status)
 {
     CurrentStatus = status;
     //Logger.Debug("Got STATUS 2 {0} {1}", OnRepositoryChanged, status);
     OnRepositoryChanged?.Invoke(CurrentStatus);
 }
示例#16
0
 public static IEnumerable <GitStatusEntry> GetEntriesExcludingIgnoredAndUntracked(this GitStatus gitStatus)
 {
     return(gitStatus.Entries.Where(entry => entry.Status != GitFileStatus.Ignored && !entry.Staged));
 }
示例#17
0
 private static void RunStatusUpdateOnMainThread(GitStatus update)
 {
     EntryPoint.ApplicationManager.TaskManager.ScheduleUI(new ActionTask(EntryPoint.ApplicationManager.TaskManager.Token, _ => OnStatusUpdate(update)));
 }