private void onMergeRequestEvent(UserEvents.MergeRequestEvent e) { if (e.New || e.Commits) { onProjectUpdate(e.FullMergeRequestKey.ProjectKey); } }
public void OnMergeRequestEvent(UserEvents.MergeRequestEvent e) { switch (e.EventType) { case UserEvents.MergeRequestEvent.Type.NewMergeRequest: Trace.TraceInformation(String.Format( "[DiscussionManager] Scheduling update of discussions for a new merge request with IId {0}", e.FullMergeRequestKey.MergeRequest.IId)); MergeRequestKey mrk = new MergeRequestKey( e.FullMergeRequestKey.ProjectKey, e.FullMergeRequestKey.MergeRequest.IId); if (_closed.Contains(mrk)) { Trace.TraceInformation(String.Format( "[DiscussionManager] Merge Request with IId {0} was reopened", e.FullMergeRequestKey.MergeRequest.IId)); _closed.Remove(mrk); } scheduleUpdate(new MergeRequestKey[] { mrk }, DiscussionUpdateType.NewMergeRequest); break; case UserEvents.MergeRequestEvent.Type.ClosedMergeRequest: { MergeRequestKey closedMRK = new MergeRequestKey( e.FullMergeRequestKey.ProjectKey, e.FullMergeRequestKey.MergeRequest.IId); Trace.TraceInformation(String.Format( "[DiscussionManager] Clean up closed MR: Project={0}, IId={1}", closedMRK.ProjectKey.ProjectName, closedMRK.IId.ToString())); _cachedDiscussions.Remove(closedMRK); _closed.Add(closedMRK); } break; case UserEvents.MergeRequestEvent.Type.UpdatedMergeRequest: // do nothing break; default: Debug.Assert(false); break; } }
private void onMergeRequestEvent(UserEvents.MergeRequestEvent e, EDataCacheType type) { MergeRequestKey mrk = new MergeRequestKey( e.FullMergeRequestKey.ProjectKey, e.FullMergeRequestKey.MergeRequest.IId); if (e.AddedToCache || e.Commits) { requestCommitStorageUpdate(mrk.ProjectKey); } if (type == EDataCacheType.Live) { if (e.AddedToCache) { // some labels may appear within a small delay after new MR is detected requestUpdates(EDataCacheType.Live, mrk, new[] { Program.Settings.OneShotUpdateOnNewMergeRequestFirstChanceDelayMs, Program.Settings.OneShotUpdateOnNewMergeRequestSecondChanceDelayMs }); } if (e.RemovedFromCache && isReviewedMergeRequest(mrk)) { cleanupReviewedMergeRequests(new MergeRequestKey[] { mrk }); } } updateMergeRequestList(type); FullMergeRequestKey?fmk = getListView(type).GetSelectedMergeRequest(); if (!fmk.HasValue || !fmk.Value.Equals(e.FullMergeRequestKey) || getCurrentTabDataCacheType() != type) { return; } if (e.Details || e.Commits || e.Labels) { // Non-grid Details are updated here and Grid ones are updated in updateMergeRequestList() above Trace.TraceInformation("[MainForm] Updating selected Merge Request ({0})", getDataCacheName(getDataCache(type))); onMergeRequestSelectionChanged(type); } }
private void onUpdate(UserEvents.MergeRequestEvent e) { MergeRequestEvent?.Invoke(e); }
private void onRecentMergeRequestEvent(UserEvents.MergeRequestEvent e) => onMergeRequestEvent(e, EDataCacheType.Recent);
private void onLiveMergeRequestEvent(UserEvents.MergeRequestEvent e) => onMergeRequestEvent(e, EDataCacheType.Live);