action.Vcs.IntegrateProject.text=Inte_grate Project
action.Vcs.IntegrateProject.description=Integrate project
-action.Vcs.RefreshStatuses.text=R_efresh File Status
-action.Vcs.RefreshStatuses.description=Refresh VCS status for all files in project
-
action.ShowNavBar.text=_Jump to Navigation Bar
action.ShowNavBar.ShortText=Navigation Bar
import com.intellij.openapi.extensions.ExtensionPointName;
import com.intellij.openapi.project.Project;
+import org.jetbrains.annotations.NotNull;
/**
* Implement to perform some activity when user presses "Refresh" button in the Changes View.
ExtensionPointName<ChangesViewRefresher> EP_NAME = ExtensionPointName.create("com.intellij.vcsChangesViewRefresher");
- void refresh(Project project);
+ void refresh(@NotNull Project project);
}
<add-to-group group-id="TouchBarDefaultOptionalGroup" anchor="first" />
</group>
+ <action id="ChangesView.Refresh" class="com.intellij.openapi.vcs.changes.actions.RefreshAction"
+ icon="AllIcons.Actions.Refresh"/>
+
<!-- Main menu | Version Control -->
<group id="VcsGroups" class="com.intellij.openapi.vcs.actions.VcsGroupsActionGroup" popup="true">
<group id="Vcs.MainMenu" class="com.intellij.openapi.vcs.actions.VcsMainMenuActionGroup">
<reference ref="ChangesView.ToggleCommitUi"/>
<reference ref="Vcs.UpdateProject"/>
<action id="Vcs.IntegrateProject" class="com.intellij.openapi.vcs.update.CommonIntegrateProjectAction"/>
- <action id="Vcs.RefreshStatuses" class="com.intellij.openapi.vcs.actions.RefreshStatuses"/>
+ <reference ref="ChangesView.Refresh"/>
<separator/>
<group id="Vcs.Specific" class="com.intellij.ide.actions.NonEmptyActionGroup"/>
<separator/>
</group>
<group id="ChangesViewToolbar">
- <action id="ChangesView.Refresh" class="com.intellij.openapi.vcs.changes.actions.RefreshAction"
- icon="AllIcons.Actions.Refresh"/>
+ <reference ref="ChangesView.Refresh"/>
<reference ref="CheckinProject"/>
<reference ref="ChangesView.ToggleCommitUi"/>
<reference ref="ChangesView.Revert"/>
<reference ref="Vcs.QuickListPopupAction"/>
<reference ref="Vcs.UpdateProject"/>
<reference ref="Vcs.IntegrateProject"/>
- <reference ref="Vcs.RefreshStatuses"/>
<separator/>
<reference ref="ChangesView.Browse"/>
<reference ref="ChangesView.CreatePatch"/>
+++ /dev/null
-// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
-package com.intellij.openapi.vcs.actions;
-
-import com.intellij.openapi.actionSystem.AnAction;
-import com.intellij.openapi.actionSystem.AnActionEvent;
-import com.intellij.openapi.project.DumbAware;
-import com.intellij.openapi.project.Project;
-import com.intellij.openapi.vcs.ProjectLevelVcsManager;
-import com.intellij.openapi.vcs.changes.VcsDirtyScopeManager;
-import org.jetbrains.annotations.NotNull;
-
-public class RefreshStatuses extends AnAction implements DumbAware {
- @Override
- public void actionPerformed(@NotNull AnActionEvent e) {
- Project project = e.getProject();
- if (project != null) {
- VcsDirtyScopeManager.getInstance(project).markEverythingDirty();
- }
- }
-
- @Override
- public void update(@NotNull AnActionEvent e) {
- final Project project = e.getProject();
- boolean isEnabled = project != null &&
- ProjectLevelVcsManager.getInstance(project).getAllActiveVcss().length > 0;
- e.getPresentation().setEnabledAndVisible(isEnabled);
- }
-}
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vcs.FilePath;
+import com.intellij.openapi.vcs.ProjectLevelVcsManager;
import com.intellij.openapi.vcs.VcsBundle;
import com.intellij.openapi.vcs.changes.*;
import com.intellij.openapi.vfs.VirtualFileManager;
* @author yole
*/
public class RefreshAction extends AnAction implements DumbAware {
+ @Override
+ public void update(@NotNull AnActionEvent e) {
+ Project project = e.getProject();
+ boolean isEnabled = project != null && ProjectLevelVcsManager.getInstance(project).hasActiveVcss();
+ e.getPresentation().setEnabledAndVisible(isEnabled);
+ }
+
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
final Project project = e.getData(CommonDataKeys.PROJECT);
</action>
<action id="Git.Show.Stage" class="git4idea.index.actions.GitShowStagingAreaAction" use-shortcut-of="CheckinProject"/>
- <action id="Git.Stage.Refresh" class="git4idea.index.actions.GitRefreshStageAction" icon="AllIcons.Actions.Refresh"
- use-shortcut-of="Refresh"/>
<action id="Git.Stage.Add" class="git4idea.index.actions.GitAddAction" use-shortcut-of="ChangesView.AddUnversioned"/>
<action id="Git.Stage.Reset" class="git4idea.index.actions.GitResetAction" use-shortcut-of="ChangesView.Revert"/>
<action id="Git.Stage.Revert" class="git4idea.index.actions.GitRevertAction" use-shortcut-of="ChangesView.Revert"/>
<group id="Git.Stage.Toolbar">
<reference id="Diff.ShowDiff"/>
- <reference id="Git.Stage.Refresh"/>
+ <reference id="ChangesView.Refresh"/>
<reference id="Git.Stash.Silently"/>
<group id="Git.Stage.Ui.Settings" icon="AllIcons.Actions.Show" popup="true">
<reference id="Git.Stage.ToggleIgnored"/>
<projectService serviceImplementation="git4idea.index.GitStageTracker"/>
<openapi.vcs.impl.LocalLineStatusTrackerProvider implementation="git4idea.index.GitStageLineStatusTrackerProvider"/>
+ <vcsChangesViewRefresher implementation="git4idea.index.actions.GitStageChangesViewRefresher"/>
<backgroundPostStartupActivity implementation="git4idea.index.GitStageManager$GitStageStartupActivity"/>
import org.jetbrains.annotations.NotNull;
/**
- * Untracked files in Git are not queried within the normal refresh procedure - they are watched separately.
+ * Untracked and ignored files in Git are not queried within the normal refresh procedure - they are watched separately.
* I.e. to make a full refresh when user presses "Refresh" in the Changes View it is needed to prepare untracked files for refresh as well.
- *
- * @author Kirill Likhodedov
*/
public class GitChangesViewRefresher implements ChangesViewRefresher {
-
@Override
public void refresh(@NotNull Project project) {
GitRepositoryManager repositoryManager = GitRepositoryManager.getInstance(project);
for (GitRepository repository : repositoryManager.getRepositories()) {
repository.getUntrackedFilesHolder().invalidate();
+ repository.getIgnoredFilesHolder().startRescan();
}
}
}
+++ /dev/null
-// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
-package git4idea.index.actions
-
-import com.intellij.openapi.actionSystem.AnActionEvent
-import com.intellij.openapi.project.DumbAwareAction
-import com.intellij.openapi.vcs.VcsBundle
-import git4idea.index.ui.GitStageDataKeys
-import git4idea.index.vfs.GitIndexFileSystemRefresher
-
-class GitRefreshStageAction : DumbAwareAction(VcsBundle.messagePointer("action.name.refresh")) {
-
- override fun update(e: AnActionEvent) {
- e.presentation.isEnabledAndVisible = e.getData(GitStageDataKeys.GIT_STAGE_TRACKER) != null && e.project != null
- }
-
- override fun actionPerformed(e: AnActionEvent) {
- e.getRequiredData(GitStageDataKeys.GIT_STAGE_TRACKER).scheduleUpdateAll()
- GitIndexFileSystemRefresher.getInstance(e.project!!).refresh { true }
- }
-}
\ No newline at end of file
--- /dev/null
+// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
+package git4idea.index.actions
+
+import com.intellij.openapi.project.Project
+import com.intellij.openapi.vcs.changes.ChangesViewRefresher
+import git4idea.index.vfs.GitIndexFileSystemRefresher
+
+class GitStageChangesViewRefresher : ChangesViewRefresher {
+ override fun refresh(project: Project) {
+ GitIndexFileSystemRefresher.getInstance(project).refresh { true }
+ }
+}