mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
style
This commit is contained in:
@@ -175,7 +175,7 @@ public abstract class DvcsCommitAdditionalComponent implements RefreshableOnComp
|
||||
}
|
||||
|
||||
@NotNull
|
||||
protected abstract Set<VirtualFile> getVcsRoots(Collection<FilePath> files);
|
||||
protected abstract Set<VirtualFile> getVcsRoots(@NotNull Collection<FilePath> files);
|
||||
|
||||
@Nullable
|
||||
protected abstract String getLastCommitMessage(@NotNull VirtualFile repo) throws VcsException;
|
||||
|
||||
@@ -649,7 +649,7 @@ public class GitCheckinEnvironment implements CheckinEnvironment {
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
protected Set<VirtualFile> getVcsRoots(Collection<FilePath> filePaths) {
|
||||
protected Set<VirtualFile> getVcsRoots(@NotNull Collection<FilePath> filePaths) {
|
||||
return GitUtil.gitRoots(filePaths);
|
||||
}
|
||||
|
||||
@@ -675,12 +675,14 @@ public class GitCheckinEnvironment implements CheckinEnvironment {
|
||||
return NewGitUsersComponent.getInstance(project).get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void refresh() {
|
||||
super.refresh();
|
||||
myAuthor.setSelectedItem("");
|
||||
reset();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveState() {
|
||||
String author = (String)myAuthor.getEditor().getItem();
|
||||
myNextCommitAuthor = author.length() == 0 ? null : author;
|
||||
@@ -695,6 +697,7 @@ public class GitCheckinEnvironment implements CheckinEnvironment {
|
||||
myNextCommitAuthorDate = myAuthorDate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restoreState() {
|
||||
refresh();
|
||||
}
|
||||
|
||||
@@ -264,31 +264,33 @@ public class HgCheckinEnvironment implements CheckinEnvironment {
|
||||
public HgCommitAdditionalComponent(@NotNull Project project, @NotNull CheckinProjectPanel panel) {
|
||||
super(project, panel);
|
||||
HgVcs myVcs = HgVcs.getInstance(myProject);
|
||||
if (myVcs != null && !myVcs.getVersion().isAmendSupported()) {
|
||||
myAmend.setEnabled(false);
|
||||
}
|
||||
myAmend.setEnabled(myVcs != null && myVcs.getVersion().isAmendSupported());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void refresh() {
|
||||
super.refresh();
|
||||
myNextCommitAmend = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveState() {
|
||||
myNextCommitAmend = myAmend.isSelected();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restoreState() {
|
||||
myNextCommitAmend = false;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Set<VirtualFile> getVcsRoots(Collection<FilePath> filePaths) {
|
||||
protected Set<VirtualFile> getVcsRoots(@NotNull Collection<FilePath> filePaths) {
|
||||
return HgUtil.hgRoots(myProject, filePaths);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
protected String getLastCommitMessage(@NotNull VirtualFile repo) throws VcsException {
|
||||
HgCommandExecutor commandExecutor = new HgCommandExecutor(myProject);
|
||||
List<String> args = new ArrayList<String>();
|
||||
|
||||
@@ -40,6 +40,7 @@ import com.intellij.openapi.wm.StatusBar;
|
||||
import com.intellij.openapi.wm.WindowManager;
|
||||
import com.intellij.openapi.wm.impl.status.StatusBarUtil;
|
||||
import com.intellij.ui.GuiUtils;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.vcsUtil.VcsUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -244,17 +245,15 @@ public abstract class HgUtil {
|
||||
* Get hg roots for paths
|
||||
*
|
||||
* @param filePaths the context paths
|
||||
* @return a set of git roots
|
||||
* @return a set of hg roots
|
||||
*/
|
||||
public static Set<VirtualFile> hgRoots(@NotNull Project project, final Collection<FilePath> filePaths) {
|
||||
HashSet<VirtualFile> rc = new HashSet<VirtualFile>();
|
||||
@NotNull
|
||||
public static Set<VirtualFile> hgRoots(@NotNull Project project, @NotNull Collection<FilePath> filePaths) {
|
||||
HashSet<VirtualFile> roots = new HashSet<VirtualFile>();
|
||||
for (FilePath path : filePaths) {
|
||||
final VirtualFile root = getHgRootOrNull(project, path);
|
||||
if (root != null) {
|
||||
rc.add(root);
|
||||
}
|
||||
ContainerUtil.addIfNotNull(roots, getHgRootOrNull(project, path));
|
||||
}
|
||||
return rc;
|
||||
return roots;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user