private void Construct(GitManager gitManager, GitReflectionHelper reflectionHelper, UniGitData data, ILogger logger, GitSettingsJson gitSettings, GitCallbacks gitCallbacks, GitInitializer initializer, GitSettingsManager settingsManager, UniGitPaths paths, IGitResourceManager resourceManager) { this.resourceManager = resourceManager; this.paths = paths; this.settingsManager = settingsManager; this.logger = logger; this.gitSettings = gitSettings; this.initializer = initializer; if (gitManager == null) { logger.Log(LogType.Error, "Git manager cannot be null."); return; } if (this.gitCallbacks != null) { Unsubscribe(this.gitCallbacks); } this.data = data; this.gitManager = gitManager; this.gitManager.AddWatcher(this); this.reflectionHelper = reflectionHelper; Subscribe(gitCallbacks); }
private static void Rebuild(InjectionHelper injectionHelper) { GitCallbacks = injectionHelper.GetInstance <GitCallbacks>(); var settingsManager = injectionHelper.GetInstance <GitSettingsManager>(); settingsManager.LoadGitSettings(); //delayed called must be used for serialized properties to be loaded EditorApplication.delayCall += () => { settingsManager.LoadOldSettingsFile(); }; GitManager = injectionHelper.GetInstance <GitManager>(); injectionHelper.GetInstance <GitReflectionHelper>(); GitSettings = injectionHelper.GetInstance <GitSettingsJson>(); GitCallbacks.OnLogEntry += OnLogEntry; GitCallbacks.OnBeforeAssemblyReload += OnBeforeAssemblyReload; injectionHelper.CreateNonLazy(); injectionHelper.InjectStatic(typeof(GitProjectContextMenus)); injectionHelper.InjectStatic(typeof(GitUnityMenu)); }
public GitLfsManager(GitManager gitManager, GitCallbacks gitCallbacks, ILogger logger, GitSettingsJson gitSettings) { this.gitManager = gitManager; this.gitCallbacks = gitCallbacks; this.logger = logger; this.gitSettings = gitSettings; gitCallbacks.UpdateRepository += OnUpdateRepository; gitManager.AddSettingsAffector(this); try { version = GitHelper.RunExeOutput(gitManager.GetCurrentRepoPath(), "git-lfs", "version", null); isInstalled = true; } catch (Exception) { isInstalled = false; return; } UpdateInitilized(); if (Initilized) { RegisterFilter(); Update(); } }
private static void Update(bool reloadRepository, string[] paths = null) { StartUpdating(paths); if ((repository == null || reloadRepository) && IsValidRepo) { if (repository != null) { repository.Dispose(); } repository = new Repository(RepoPath); GitCallbacks.IssueOnRepositoryLoad(repository); } if (repository != null) { if (Settings.GitStatusMultithreaded) { ThreadPool.QueueUserWorkItem(ReteriveStatusThreaded, paths); } else { RetreiveStatus(paths); } } }
private static void ReteriveStatusThreaded(object param) { Monitor.Enter(statusRetriveLock); try { string[] paths = param as string[]; RebuildStatus(paths); actionQueue.Enqueue(() => { GitCallbacks.IssueUpdateRepository(status, paths); ThreadPool.QueueUserWorkItem(UpdateStatusTreeThreaded, status); }); } catch (ThreadAbortException) { actionQueue.Enqueue(FinishUpdating); } catch (Exception e) { Debug.LogException(e); actionQueue.Enqueue(FinishUpdating); } finally { Monitor.Exit(statusRetriveLock); } }
public GitCheckoutWindowPopup(GitManager gitManager, Branch branch, ILogger logger, GitCallbacks gitCallbacks) { this.gitManager = gitManager; this.branch = branch; this.logger = logger; this.gitCallbacks = gitCallbacks; }
public GitAutoFetcher(GitManager gitManager, GitCredentialsManager credentialsManager, GitCallbacks gitCallbacks) { this.gitManager = gitManager; this.credentialsManager = credentialsManager; this.gitCallbacks = gitCallbacks; gitCallbacks.EditorUpdate += OnEditorUpdate; needsFetch = !EditorApplication.isPlayingOrWillChangePlaymode && !EditorApplication.isCompiling && !EditorApplication.isUpdating; }
public GitSettingsManager(GitSettingsJson settings, string settingsPath, GitCallbacks gitCallbacks) { this.settings = settings; this.settingsPath = settingsPath; this.gitCallbacks = gitCallbacks; gitCallbacks.EditorUpdate += OnEditorUpdate; }
private static void RetreiveStatus(string[] paths) { GitProfilerProxy.BeginSample("Git Repository Status Retrieval"); RebuildStatus(paths); GitProfilerProxy.EndSample(); GitCallbacks.IssueUpdateRepository(status, paths); ThreadPool.QueueUserWorkItem(UpdateStatusTreeThreaded, status); }
public GitInitializer( UniGitPaths paths, ILogger logger, GitCallbacks callbacks) { this.paths = paths; this.logger = logger; this.callbacks = callbacks; }
public GitDiffElementContextFactory(GitManager gitManager, GitConflictsHandler conflictsHandler, GitOverlay gitOverlay, GitExternalManager externalManager, GitCallbacks gitCallbacks) { this.gitManager = gitManager; this.conflictsHandler = conflictsHandler; this.gitOverlay = gitOverlay; this.externalManager = externalManager; this.gitCallbacks = gitCallbacks; }
public GitSettingsManager(UniGitPaths paths, GitSettingsJson settings, GitCallbacks gitCallbacks, ILogger logger, GitInitializer initializer) { this.paths = paths; this.settings = settings; this.gitCallbacks = gitCallbacks; this.logger = logger; this.initializer = initializer; gitCallbacks.EditorUpdate += OnEditorUpdate; }
private static void StartUpdating(string[] paths) { isUpdating = true; updatingFiles.Clear(); if (paths != null) { updatingFiles.AddRange(paths); } GitCallbacks.IssueUpdateRepositoryStart(); }
public GitManager(string repoPath, GitCallbacks callbacks, GitSettingsJson settings, IGitPrefs prefs, GitAsyncManager asyncManager) { this.repoPath = repoPath; this.callbacks = callbacks; this.prefs = prefs; this.asyncManager = asyncManager; gitSettings = settings; gitPath = UniGitPath.Combine(repoPath, ".git"); Initialize(); }
protected virtual void Unsubscribe(GitCallbacks callbacks) { if (callbacks == null) { return; } callbacks.EditorUpdate -= OnEditorUpdateInternal; callbacks.UpdateRepository -= OnGitManagerUpdateRepositoryInternal; callbacks.OnRepositoryLoad -= OnRepositoryLoad; callbacks.UpdateRepositoryStart -= UpdateTitleIcon; callbacks.RepositoryCreate -= OnRepositoryCreate; }
protected virtual void Subscribe(GitCallbacks callbacks) { if (callbacks == null) { Debug.LogError("Trying to subscribe to null callbacks"); return; } callbacks.EditorUpdate += OnEditorUpdateInternal; callbacks.UpdateRepository += OnGitManagerUpdateRepositoryInternal; callbacks.OnRepositoryLoad += OnRepositoryLoad; callbacks.UpdateRepositoryStart += UpdateTitleIcon; callbacks.RepositoryCreate += OnRepositoryCreate; }
public GitCredentialsManager(GitManager gitManager, GitSettingsJson gitSettings, List <ICredentialsAdapter> adapters, GitCallbacks gitCallbacks) { this.gitSettings = gitSettings; this.gitManager = gitManager; this.adapters = adapters.ToArray(); this.gitCallbacks = gitCallbacks; adapterNames = adapters.Select(a => new GUIContent(GetAdapterName(a))).ToArray(); adapterIds = adapters.Select(GetAdapterId).ToArray(); gitCallbacks.EditorUpdate += EditorUpdate; LoadGitCredentials(); }
private static GitCallbacks GetGitCallbacks(InjectionHelper.ResolveCreateContext context) { var c = new GitCallbacks(); EditorApplication.update += c.IssueEditorUpdate; c.RefreshAssetDatabase += AssetDatabase.Refresh; c.SaveAssetDatabase += AssetDatabase.SaveAssets; EditorApplication.playModeStateChanged += c.IssueOnPlayModeStateChange; EditorApplication.projectWindowItemOnGUI += c.IssueProjectWindowItemOnGUI; //asset postprocessing GitAssetPostprocessors.OnWillSaveAssetsEvent += c.IssueOnWillSaveAssets; GitAssetPostprocessors.OnPostprocessImportedAssetsEvent += c.IssueOnPostprocessImportedAssets; GitAssetPostprocessors.OnPostprocessDeletedAssetsEvent += c.IssueOnPostprocessDeletedAssets; GitAssetPostprocessors.OnPostprocessMovedAssetsEvent += c.IssueOnPostprocessMovedAssets; return(c); }
public GitLog(UniGitPaths paths, UniGitData data, GitSettingsJson gitSettings, GitCallbacks gitCallbacks) { this.paths = paths; this.data = data; this.gitSettings = gitSettings; this.gitCallbacks = gitCallbacks; logTypeRegex = new Regex(@"\[.*?\]", RegexOptions.Compiled); lineAndNumberRegex = new Regex(@"\(at((.*?):(.*?))\)", RegexOptions.Compiled); if (data.LogInitialized) { data.LogInitialized = true; data.LogEntries.Clear(); LoadLines(); } }
internal static void Init(GitManager gitManager, GitExternalManager externalManager, GitCallbacks gitCallbacks, ILogger logger, GitProjectOverlay gitProjectOverlay, GitReflectionHelper reflectionHelper, GitInitializer initializer) { GitProjectContextMenus.gitManager = gitManager; GitProjectContextMenus.externalManager = externalManager; GitProjectContextMenus.gitCallbacks = gitCallbacks; GitProjectContextMenus.logger = logger; GitProjectContextMenus.reflectionHelper = reflectionHelper; GitProjectContextMenus.gitProjectOverlay = gitProjectOverlay; GitProjectContextMenus.initializer = initializer; }
public GitAutoFetcher(GitManager gitManager, GitCredentialsManager credentialsManager, GitCallbacks gitCallbacks, GitSettingsJson gitSettings, ILogger logger, GitInitializer initializer) { this.gitManager = gitManager; this.credentialsManager = credentialsManager; this.gitCallbacks = gitCallbacks; this.logger = logger; this.gitSettings = gitSettings; this.initializer = initializer; gitCallbacks.EditorUpdate += OnEditorUpdate; needsFetch = !EditorApplication.isPlayingOrWillChangePlaymode && !EditorApplication.isCompiling && !EditorApplication.isUpdating; }
private static void RetreiveStatus(string[] paths) { try { GitProfilerProxy.BeginSample("Git Repository Status Retrieval"); RebuildStatus(paths); GitProfilerProxy.EndSample(); GitCallbacks.IssueUpdateRepository(status, paths); ThreadPool.QueueUserWorkItem(UpdateStatusTreeThreaded, status); } catch (Exception e) { FinishUpdating(); Debug.LogError("Could not retrive Git Status"); Debug.LogException(e); } }
public GitProjectOverlay(GitManager gitManager, GitCallbacks gitCallbacks, GitSettingsJson gitSettings, GitAsyncManager asyncManager) { if (iconStyle == null) { iconStyle = new GUIStyle { imagePosition = ImagePosition.ImageOnly, alignment = TextAnchor.LowerLeft, padding = new RectOffset(2, 2, 2, 2) }; } this.gitManager = gitManager; this.gitSettings = gitSettings; this.asyncManager = asyncManager; this.gitCallbacks = gitCallbacks; gitCallbacks.ProjectWindowItemOnGUI += CustomIcons; gitCallbacks.UpdateRepository += OnUpdateRepository; }
public GitManager( GitCallbacks callbacks, GitSettingsJson settings, IGitPrefs prefs, GitAsyncManager asyncManager, UniGitData gitData, ILogger logger, GitInitializer initializer, UniGitPaths paths) { this.paths = paths; this.gitData = gitData; this.callbacks = callbacks; this.prefs = prefs; this.asyncManager = asyncManager; this.logger = logger; this.initializer = initializer; gitSettings = settings; Initialize(); }
public GitFileWatcher(GitManager gitManager, GitCallbacks gitCallbacks, GitSettingsJson gitSettings, UniGitPaths paths, [UniGitInjectOptional] bool trackAssetsPath) { this.paths = paths; this.gitManager = gitManager; this.gitSettings = gitSettings; this.gitCallbacks = gitCallbacks; fileWatchers = new List <FileSystemWatcher>(); string regexPattern = @".*.git$"; if (!trackAssetsPath) { regexPattern += "|.*Assets$"; } ignoreFoldersRegex = new Regex(regexPattern); gitCallbacks.OnSettingsChange += OnSettingsChange; gitCallbacks.OnRepositoryLoad += OnRepositoryLoad; }
private static void FinishUpdating() { isUpdating = false; updatingFiles.Clear(); GitCallbacks.IssueUpdateRepositoryFinish(); }
private void Construct(GitCallbacks gitCallbacks) { this.gitCallbacks = gitCallbacks; mergeOptions.OnCheckoutNotify = gitManager.CheckoutNotifyHandler; mergeOptions.OnCheckoutProgress = gitManager.CheckoutProgressHandler; }
protected override void Unsubscribe(GitCallbacks callbacks) { base.Unsubscribe(callbacks); callbacks.AsyncStageOperationDone -= OnAsyncStageOperationDone; }
public GitStashWindow(GitManager gitManager, GitOverlay gitOverlay, GitCallbacks gitCallbacks) { this.gitManager = gitManager; this.gitOverlay = gitOverlay; this.gitCallbacks = gitCallbacks; }
private void Construct(GitLog gitLog, GitCallbacks gitCallbacks) { this.gitLog = gitLog; this.gitCallbacks = gitCallbacks; gitCallbacks.OnLogEntry += OnLogEntry; }