예제 #1
0
        static void ShowIncomingChangesForMode(
            WorkspaceInfo workspaceInfo,
            IMergeViewLauncher mergeViewLauncher,
            IGluonViewSwitcher gluonSwitcher,
            bool isGluonMode)
        {
            if (isGluonMode)
            {
                GluonShowIncomingChanges.FromNotificationBar(
                    workspaceInfo, gluonSwitcher);
                return;
            }

            ShowIncomingChanges.FromNotificationBar(
                workspaceInfo, mergeViewLauncher);
        }
예제 #2
0
        internal static void CheckinPaths(
            WorkspaceInfo wkInfo,
            List <string> paths,
            string comment,
            IWorkspaceWindow workspaceWindow,
            CheckinDialog dialog,
            GuiMessage.IGuiMessage guiMessage,
            IProgressControls progressControls,
            IMergeViewLauncher mergeViewLauncher)
        {
            BaseCommandsImpl baseCommands = new BaseCommandsImpl();

            progressControls.ShowProgress("Checkin in files");

            IThreadWaiter waiter = ThreadWaiter.GetWaiter(50);

            waiter.Execute(
                /*threadOperationDelegate*/ delegate
            {
                CheckinParams ciParams = new CheckinParams();
                ciParams.paths         = paths.ToArray();
                ciParams.comment       = comment;
                ciParams.time          = DateTime.MinValue;
                ciParams.flags         = CheckinFlags.Recurse | CheckinFlags.ProcessSymlinks;

                baseCommands.CheckIn(ciParams);
            },
                /*afterOperationDelegate*/ delegate
            {
                progressControls.HideProgress();
                ((IPlasticDialogCloser)dialog).CloseDialog();

                if (waiter.Exception is CmClientMergeNeededException ||
                    waiter.Exception is CmClientUpdateMergeNeededException)
                {
                    // we need to explicitly call EditorWindow.Close() to ensure
                    // that the dialog is closed before asking the user
                    dialog.Close();

                    if (!UserWantsToShowIncomingView(guiMessage))
                    {
                        return;
                    }

                    ShowIncomingChanges.FromCheckin(
                        wkInfo,
                        mergeViewLauncher,
                        progressControls);

                    return;
                }

                if (waiter.Exception != null)
                {
                    ExceptionsHandler.DisplayException(waiter.Exception);
                    return;
                }

                workspaceWindow.RefreshView(ViewType.PendingChangesView);
                workspaceWindow.RefreshView(ViewType.HistoryView);
            });
        }