mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Git cleanup: add wildcards to conform to API conventions
GitOrigin-RevId: bbec921aea2c0e04240b7dbd222b68bcc4d6f8c5
This commit is contained in:
committed by
intellij-monorepo-bot
parent
79921ee413
commit
8e3d33bb9a
@@ -23,9 +23,9 @@ import org.jetbrains.annotations.Nullable;
|
||||
import java.util.Collection;
|
||||
|
||||
public abstract class DvcsMultiRootBranchConfig<Repo extends Repository> {
|
||||
@NotNull protected final Collection<Repo> myRepositories;
|
||||
@NotNull protected final Collection<? extends Repo> myRepositories;
|
||||
|
||||
public DvcsMultiRootBranchConfig(@NotNull Collection<Repo> repositories) {
|
||||
public DvcsMultiRootBranchConfig(@NotNull Collection<? extends Repo> repositories) {
|
||||
myRepositories = repositories;
|
||||
}
|
||||
|
||||
|
||||
@@ -147,9 +147,9 @@ public abstract class DvcsTaskHandler<R extends Repository> extends VcsTaskHandl
|
||||
return ContainerUtil.mapNotNull(urls, (NullableFunction<String, R>)s -> ContainerUtil.find(repositories, repository -> s.equals(repository.getPresentableUrl())));
|
||||
}
|
||||
|
||||
protected abstract void checkout(@NotNull String taskName, @NotNull List<R> repos, @Nullable Runnable callInAwtLater);
|
||||
protected abstract void checkout(@NotNull String taskName, @NotNull List<? extends R> repos, @Nullable Runnable callInAwtLater);
|
||||
|
||||
protected abstract void checkoutAsNewBranch(@NotNull String name, @NotNull List<R> repositories);
|
||||
protected abstract void checkoutAsNewBranch(@NotNull String name, @NotNull List<? extends R> repositories);
|
||||
|
||||
@Nullable
|
||||
protected abstract String getActiveBranch(R repository);
|
||||
@@ -157,7 +157,7 @@ public abstract class DvcsTaskHandler<R extends Repository> extends VcsTaskHandl
|
||||
@NotNull
|
||||
protected abstract Iterable<TaskInfo> getAllBranches(@NotNull R repository);
|
||||
|
||||
protected abstract void mergeAndClose(@NotNull String branch, @NotNull List<R> repositories);
|
||||
protected abstract void mergeAndClose(@NotNull String branch, @NotNull List<? extends R> repositories);
|
||||
|
||||
protected abstract boolean hasBranch(@NotNull R repository, @NotNull TaskInfo name);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public interface CommittedChangesProvider<T extends CommittedChangeList, U exten
|
||||
|
||||
List<T> getCommittedChanges(U settings, RepositoryLocation location, final int maxCount) throws VcsException;
|
||||
|
||||
void loadCommittedChanges(U settings, RepositoryLocation location, final int maxCount, final AsynchConsumer<CommittedChangeList> consumer) throws VcsException;
|
||||
void loadCommittedChanges(U settings, RepositoryLocation location, final int maxCount, final AsynchConsumer<? super CommittedChangeList> consumer) throws VcsException;
|
||||
|
||||
ChangeListColumn[] getColumns();
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ public interface VcsOutgoingChangesProvider <T extends CommittedChangeList> exte
|
||||
Pair<VcsRevisionNumber, List<T>> getOutgoingChanges(final VirtualFile vcsRoot, final boolean findRemote) throws VcsException;
|
||||
@Nullable
|
||||
VcsRevisionNumber getMergeBaseNumber(final VirtualFile anyFileUnderRoot) throws VcsException;
|
||||
Collection<Change> filterLocalChangesBasedOnLocalCommits(final Collection<Change> localChanges, final VirtualFile vcsRoot) throws VcsException;
|
||||
Collection<Change> filterLocalChangesBasedOnLocalCommits(final Collection<? extends Change> localChanges, final VirtualFile vcsRoot) throws VcsException;
|
||||
@Nullable
|
||||
Date getRevisionDate(final VcsRevisionNumber revision, FilePath file);
|
||||
}
|
||||
|
||||
+8
-7
@@ -16,6 +16,7 @@
|
||||
package com.intellij.openapi.vcs.changes.committed;
|
||||
|
||||
import com.intellij.openapi.vcs.versionBrowser.CommittedChangeList;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -29,17 +30,17 @@ import java.util.List;
|
||||
public interface ChangeListFilteringStrategy {
|
||||
@Nullable
|
||||
JComponent getFilterUI();
|
||||
void setFilterBase(List<CommittedChangeList> changeLists);
|
||||
void setFilterBase(List<? extends CommittedChangeList> changeLists);
|
||||
void addChangeListener(ChangeListener listener);
|
||||
void removeChangeListener(ChangeListener listener);
|
||||
CommittedChangesFilterKey getKey();
|
||||
|
||||
@Nullable
|
||||
void resetFilterBase();
|
||||
void appendFilterBase(List<CommittedChangeList> changeLists);
|
||||
void appendFilterBase(List<? extends CommittedChangeList> changeLists);
|
||||
|
||||
@NotNull
|
||||
List<CommittedChangeList> filterChangeLists(List<CommittedChangeList> changeLists);
|
||||
List<CommittedChangeList> filterChangeLists(List<? extends CommittedChangeList> changeLists);
|
||||
|
||||
ChangeListFilteringStrategy NONE = new ChangeListFilteringStrategy() {
|
||||
private final CommittedChangesFilterKey myKey = new CommittedChangesFilterKey("None", CommittedChangesFilterPriority.NONE);
|
||||
@@ -55,7 +56,7 @@ public interface ChangeListFilteringStrategy {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFilterBase(List<CommittedChangeList> changeLists) {
|
||||
public void setFilterBase(List<? extends CommittedChangeList> changeLists) {
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -72,13 +73,13 @@ public interface ChangeListFilteringStrategy {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appendFilterBase(List<CommittedChangeList> changeLists) {
|
||||
public void appendFilterBase(List<? extends CommittedChangeList> changeLists) {
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public List<CommittedChangeList> filterChangeLists(List<CommittedChangeList> changeLists) {
|
||||
return changeLists;
|
||||
public List<CommittedChangeList> filterChangeLists(List<? extends CommittedChangeList> changeLists) {
|
||||
return ContainerUtil.immutableList(changeLists);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ public abstract class BeforeCheckinDialogHandler {
|
||||
* @return false to cancel commit
|
||||
*/
|
||||
@Deprecated
|
||||
public boolean beforeCommitDialogShownCallback(Iterable<CommitExecutor> executors, boolean showVcsCommit) {
|
||||
public boolean beforeCommitDialogShownCallback(Iterable<? extends CommitExecutor> executors, boolean showVcsCommit) {
|
||||
throw new AbstractMethodError();
|
||||
}
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ public class VcsAnnotationCachedProxy implements AnnotationProvider {
|
||||
* @param currentRevision - just a hint for optimization
|
||||
*/
|
||||
private FileAnnotation annotate(VirtualFile file, final VcsRevisionNumber revisionNumber, final boolean currentRevision,
|
||||
final ThrowableComputable<FileAnnotation, VcsException> delegate) throws VcsException {
|
||||
final ThrowableComputable<? extends FileAnnotation, VcsException> delegate) throws VcsException {
|
||||
|
||||
final FilePath filePath = VcsUtil.getFilePath(file);
|
||||
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ import java.util.List;
|
||||
public interface VcsCacheableHistorySessionFactory<Cacheable extends Serializable, T extends VcsAbstractHistorySession> {
|
||||
|
||||
T createFromCachedData(@Nullable Cacheable cacheable,
|
||||
@NotNull List<VcsFileRevision> revisions,
|
||||
@NotNull List<? extends VcsFileRevision> revisions,
|
||||
@NotNull FilePath filePath,
|
||||
@Nullable VcsRevisionNumber currentRevision);
|
||||
|
||||
|
||||
@@ -17,16 +17,16 @@ public interface MergeSessionEx extends MergeSession {
|
||||
/**
|
||||
* Called when user executes "Accept Theirs" or "Accept Ours" action to update file content on disk to the selected version.
|
||||
*
|
||||
* @param files
|
||||
* @param resolution AcceptedYours or AcceptedTheirs
|
||||
*/
|
||||
void acceptFilesRevisions(@NotNull List<VirtualFile> files, @NotNull MergeSessionEx.Resolution resolution) throws VcsException;
|
||||
void acceptFilesRevisions(@NotNull List<? extends VirtualFile> files, @NotNull Resolution resolution) throws VcsException;
|
||||
|
||||
/**
|
||||
* Called after conflict resolution for conflicting files.
|
||||
* @see #conflictResolvedForFile
|
||||
*
|
||||
* @param files the conflicting file.
|
||||
*@param files the conflicting file.
|
||||
* @param resolution the used resolution.
|
||||
*/
|
||||
void conflictResolvedForFiles(@NotNull List<VirtualFile> files, @NotNull Resolution resolution);
|
||||
void conflictResolvedForFiles(@NotNull List<? extends VirtualFile> files, @NotNull Resolution resolution);
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public class UpdatedFiles implements JDOMExternalizable {
|
||||
return findByIdIn(myGroups, id);
|
||||
}
|
||||
|
||||
private static FileGroup findByIdIn(List<FileGroup> groups, String id) {
|
||||
private static FileGroup findByIdIn(List<? extends FileGroup> groups, String id) {
|
||||
for (FileGroup fileGroup : groups) {
|
||||
if (id.equals(fileGroup.getId())) return fileGroup;
|
||||
FileGroup foundInChildren = findByIdIn(fileGroup.getChildren(), id);
|
||||
|
||||
@@ -19,7 +19,7 @@ public interface VcsPreservingExecutor {
|
||||
* @return true if the executor supports provided roots or false otherwise.
|
||||
*/
|
||||
boolean execute(@NotNull Project project,
|
||||
@NotNull Collection<VirtualFile> rootsToSave,
|
||||
@NotNull Collection<? extends VirtualFile> rootsToSave,
|
||||
@NotNull String operationTitle,
|
||||
@NotNull ProgressIndicator indicator,
|
||||
@NotNull Runnable operation);
|
||||
|
||||
@@ -46,7 +46,7 @@ public class VcsShelveChangesSaver {
|
||||
return myShelvedLists;
|
||||
}
|
||||
|
||||
public void save(@NotNull Collection<VirtualFile> rootsToSave) throws VcsException {
|
||||
public void save(@NotNull Collection<? extends VirtualFile> rootsToSave) throws VcsException {
|
||||
LOG.info("save " + rootsToSave);
|
||||
final Map<String, Map<VirtualFile, Collection<Change>>> lists =
|
||||
new LocalChangesUnderRoots(myChangeManager, myVcsManager).getChangesByLists(rootsToSave);
|
||||
|
||||
@@ -77,8 +77,8 @@ public class VcsShelveUtils {
|
||||
}
|
||||
|
||||
private static void refreshFilesBeforeUnshelve(String projectPath,
|
||||
@NotNull List<ShelvedChange> shelvedChanges,
|
||||
@NotNull List<ShelvedBinaryFile> binaryFiles) {
|
||||
@NotNull List<? extends ShelvedChange> shelvedChanges,
|
||||
@NotNull List<? extends ShelvedBinaryFile> binaryFiles) {
|
||||
HashSet<File> filesToRefresh = new HashSet<>();
|
||||
shelvedChanges.forEach(c -> {
|
||||
if (c.getBeforePath() != null) {
|
||||
|
||||
+10
-10
@@ -60,7 +60,7 @@ public class ShowDiffFromLocalChangesActionProvider implements AnActionExtension
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean canShowDiff(@Nullable Project project, @NotNull Stream<Change> changes, @NotNull Stream<VirtualFile> files) {
|
||||
private static boolean canShowDiff(@Nullable Project project, @NotNull Stream<? extends Change> changes, @NotNull Stream<VirtualFile> files) {
|
||||
return files.findAny().isPresent() ||
|
||||
changes.anyMatch(it -> ChangeDiffRequestProducer.canCreate(project, it));
|
||||
}
|
||||
@@ -95,7 +95,7 @@ public class ShowDiffFromLocalChangesActionProvider implements AnActionExtension
|
||||
}
|
||||
|
||||
|
||||
private static boolean checkIfThereAreFakeRevisions(@NotNull Project project, @NotNull List<Change> changes) {
|
||||
private static boolean checkIfThereAreFakeRevisions(@NotNull Project project, @NotNull List<? extends Change> changes) {
|
||||
boolean needsConversion = false;
|
||||
for (Change change : changes) {
|
||||
final ContentRevision beforeRevision = change.getBeforeRevision();
|
||||
@@ -113,7 +113,7 @@ public class ShowDiffFromLocalChangesActionProvider implements AnActionExtension
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static List<Change> loadFakeRevisions(@NotNull Project project, @NotNull List<Change> changes) {
|
||||
private static List<Change> loadFakeRevisions(@NotNull Project project, @NotNull List<? extends Change> changes) {
|
||||
List<Change> actualChanges = new ArrayList<>();
|
||||
for (Change change : changes) {
|
||||
actualChanges.addAll(ChangeListManager.getInstance(project).getChangesIn(ChangesUtil.getFilePath(change)));
|
||||
@@ -123,8 +123,8 @@ public class ShowDiffFromLocalChangesActionProvider implements AnActionExtension
|
||||
|
||||
|
||||
private static void showDiff(@NotNull Project project,
|
||||
@NotNull List<Change> changes,
|
||||
@NotNull List<VirtualFile> unversioned,
|
||||
@NotNull List<? extends Change> changes,
|
||||
@NotNull List<? extends VirtualFile> unversioned,
|
||||
@NotNull ChangesListView changesView) {
|
||||
if (changes.size() == 1 && unversioned.isEmpty()) { // show all changes from this changelist
|
||||
Change selectedChange = changes.get(0);
|
||||
@@ -153,7 +153,7 @@ public class ShowDiffFromLocalChangesActionProvider implements AnActionExtension
|
||||
|
||||
|
||||
private static void showChangesDiff(@Nullable Project project,
|
||||
@NotNull ListSelection<Change> selection) {
|
||||
@NotNull ListSelection<? extends Change> selection) {
|
||||
ListSelection<ChangeDiffRequestChain.Producer> producers =
|
||||
selection.map(change -> ChangeDiffRequestProducer.create(project, change));
|
||||
|
||||
@@ -161,7 +161,7 @@ public class ShowDiffFromLocalChangesActionProvider implements AnActionExtension
|
||||
}
|
||||
|
||||
private static void showUnversionedDiff(@Nullable Project project,
|
||||
@NotNull ListSelection<VirtualFile> selection) {
|
||||
@NotNull ListSelection<? extends VirtualFile> selection) {
|
||||
ListSelection<ChangeDiffRequestChain.Producer> producers =
|
||||
selection.map(change -> UnversionedDiffRequestProducer.create(project, change));
|
||||
|
||||
@@ -169,8 +169,8 @@ public class ShowDiffFromLocalChangesActionProvider implements AnActionExtension
|
||||
}
|
||||
|
||||
private static void showSelectionDiff(@Nullable Project project,
|
||||
@NotNull List<Change> changes,
|
||||
@NotNull List<VirtualFile> unversioned) {
|
||||
@NotNull List<? extends Change> changes,
|
||||
@NotNull List<? extends VirtualFile> unversioned) {
|
||||
List<ChangeDiffRequestChain.Producer> changeRequests =
|
||||
ContainerUtil.mapNotNull(changes, change -> ChangeDiffRequestProducer.create(project, change));
|
||||
List<ChangeDiffRequestChain.Producer> unversionedRequests =
|
||||
@@ -180,7 +180,7 @@ public class ShowDiffFromLocalChangesActionProvider implements AnActionExtension
|
||||
}
|
||||
|
||||
private static void showDiff(@Nullable Project project,
|
||||
@NotNull List<ChangeDiffRequestChain.Producer> producers,
|
||||
@NotNull List<? extends ChangeDiffRequestChain.Producer> producers,
|
||||
int selected) {
|
||||
if (producers.isEmpty()) return;
|
||||
DiffRequestChain chain = new ChangeDiffRequestChain(producers, selected);
|
||||
|
||||
+8
-8
@@ -341,7 +341,7 @@ public class SimpleLocalChangeListDiffViewer extends SimpleDiffViewer {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected String getText(@NotNull List<MySimpleDiffChange> selectedChanges) {
|
||||
protected String getText(@NotNull List<? extends MySimpleDiffChange> selectedChanges) {
|
||||
if (!selectedChanges.isEmpty() && ContainerUtil.and(selectedChanges, change -> !change.isFromActiveChangelist())) {
|
||||
String shortChangeListName = StringUtil.trimMiddle(myChangelistName, 40);
|
||||
return String.format("Move to '%s' Changelist", StringUtil.escapeMnemonics(shortChangeListName));
|
||||
@@ -354,7 +354,7 @@ public class SimpleLocalChangeListDiffViewer extends SimpleDiffViewer {
|
||||
@Override
|
||||
protected void doPerform(@NotNull AnActionEvent e,
|
||||
@NotNull PartialLocalLineStatusTracker tracker,
|
||||
@NotNull List<MySimpleDiffChange> selectedChanges) {
|
||||
@NotNull List<? extends MySimpleDiffChange> selectedChanges) {
|
||||
BitSet selectedLines = getLocalSelectedLines(selectedChanges);
|
||||
|
||||
if (ContainerUtil.and(selectedChanges, change -> !change.isFromActiveChangelist())) {
|
||||
@@ -377,7 +377,7 @@ public class SimpleLocalChangeListDiffViewer extends SimpleDiffViewer {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected String getText(@NotNull List<MySimpleDiffChange> selectedChanges) {
|
||||
protected String getText(@NotNull List<? extends MySimpleDiffChange> selectedChanges) {
|
||||
boolean hasExcluded = ContainerUtil.or(selectedChanges, MySimpleDiffChange::isExcludedFromCommit);
|
||||
return selectedChanges.isEmpty() || !hasExcluded ? "Exclude Lines from Commit" : "Include Lines into Commit";
|
||||
}
|
||||
@@ -385,7 +385,7 @@ public class SimpleLocalChangeListDiffViewer extends SimpleDiffViewer {
|
||||
@Override
|
||||
protected void doPerform(@NotNull AnActionEvent e,
|
||||
@NotNull PartialLocalLineStatusTracker tracker,
|
||||
@NotNull List<MySimpleDiffChange> selectedChanges) {
|
||||
@NotNull List<? extends MySimpleDiffChange> selectedChanges) {
|
||||
BitSet selectedLines = getLocalSelectedLines(selectedChanges);
|
||||
|
||||
boolean hasExcluded = ContainerUtil.or(selectedChanges, MySimpleDiffChange::isExcludedFromCommit);
|
||||
@@ -404,7 +404,7 @@ public class SimpleLocalChangeListDiffViewer extends SimpleDiffViewer {
|
||||
@Override
|
||||
protected void doPerform(@NotNull AnActionEvent e,
|
||||
@NotNull PartialLocalLineStatusTracker tracker,
|
||||
@NotNull List<MySimpleDiffChange> selectedChanges) {
|
||||
@NotNull List<? extends MySimpleDiffChange> selectedChanges) {
|
||||
BitSet selectedLines = getLocalSelectedLines(selectedChanges);
|
||||
|
||||
tracker.setExcludedFromCommit(true);
|
||||
@@ -477,18 +477,18 @@ public class SimpleLocalChangeListDiffViewer extends SimpleDiffViewer {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
protected String getText(@NotNull List<MySimpleDiffChange> selectedChanges) {
|
||||
protected String getText(@NotNull List<? extends MySimpleDiffChange> selectedChanges) {
|
||||
return getTemplatePresentation().getText();
|
||||
}
|
||||
|
||||
@CalledWithWriteLock
|
||||
protected abstract void doPerform(@NotNull AnActionEvent e,
|
||||
@NotNull PartialLocalLineStatusTracker tracker,
|
||||
@NotNull List<MySimpleDiffChange> selectedChanges);
|
||||
@NotNull List<? extends MySimpleDiffChange> selectedChanges);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static BitSet getLocalSelectedLines(@NotNull List<MySimpleDiffChange> changes) {
|
||||
private static BitSet getLocalSelectedLines(@NotNull List<? extends MySimpleDiffChange> changes) {
|
||||
BitSet selectedLines = new BitSet();
|
||||
for (SimpleDiffChange change : changes) {
|
||||
int startLine = change.getStartLine(Side.RIGHT);
|
||||
|
||||
+4
-4
@@ -84,7 +84,7 @@ public class ColumnFilteringStrategy implements ChangeListFilteringStrategy {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFilterBase(List<CommittedChangeList> changeLists) {
|
||||
public void setFilterBase(List<? extends CommittedChangeList> changeLists) {
|
||||
myPreferredSelection = null;
|
||||
appendFilterBase(changeLists);
|
||||
}
|
||||
@@ -109,7 +109,7 @@ public class ColumnFilteringStrategy implements ChangeListFilteringStrategy {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appendFilterBase(List<CommittedChangeList> changeLists) {
|
||||
public void appendFilterBase(List<? extends CommittedChangeList> changeLists) {
|
||||
final Object[] oldSelection = myModel.isEmpty() ? myPreferredSelection : myValueList.getSelectedValues();
|
||||
|
||||
myModel.addNext(changeLists, ourConvertorInstance);
|
||||
@@ -134,10 +134,10 @@ public class ColumnFilteringStrategy implements ChangeListFilteringStrategy {
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public List<CommittedChangeList> filterChangeLists(List<CommittedChangeList> changeLists) {
|
||||
public List<CommittedChangeList> filterChangeLists(List<? extends CommittedChangeList> changeLists) {
|
||||
final Object[] selection = myValueList.getSelectedValues();
|
||||
if (myValueList.getSelectedIndex() == 0 || selection.length == 0) {
|
||||
return changeLists;
|
||||
return ContainerUtil.immutableList(changeLists);
|
||||
}
|
||||
List<CommittedChangeList> result = new ArrayList<>();
|
||||
for (CommittedChangeList changeList : changeLists) {
|
||||
|
||||
+4
-4
@@ -262,7 +262,7 @@ public class CommittedChangesPanel extends JPanel implements TypeSafeDataProvide
|
||||
}
|
||||
}
|
||||
|
||||
private void updateFilteredModel(List<CommittedChangeList> committedChangeLists, final boolean reset) {
|
||||
private void updateFilteredModel(List<? extends CommittedChangeList> committedChangeLists, final boolean reset) {
|
||||
if (committedChangeLists == null) {
|
||||
return;
|
||||
}
|
||||
@@ -340,7 +340,7 @@ public class CommittedChangesPanel extends JPanel implements TypeSafeDataProvide
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public void setFilterBase(List<CommittedChangeList> changeLists) {
|
||||
public void setFilterBase(List<? extends CommittedChangeList> changeLists) {
|
||||
}
|
||||
@Override
|
||||
public void addChangeListener(ChangeListener listener) {
|
||||
@@ -354,11 +354,11 @@ public class CommittedChangesPanel extends JPanel implements TypeSafeDataProvide
|
||||
public void resetFilterBase() {
|
||||
}
|
||||
@Override
|
||||
public void appendFilterBase(List<CommittedChangeList> changeLists) {
|
||||
public void appendFilterBase(List<? extends CommittedChangeList> changeLists) {
|
||||
}
|
||||
@Override
|
||||
@NotNull
|
||||
public List<CommittedChangeList> filterChangeLists(List<CommittedChangeList> changeLists) {
|
||||
public List<CommittedChangeList> filterChangeLists(List<? extends CommittedChangeList> changeLists) {
|
||||
final FilterHelper filterHelper;
|
||||
setEmptyMessage(myChangesLoaded);
|
||||
if (myRegexCheckbox.isSelected()) {
|
||||
|
||||
+3
-3
@@ -92,7 +92,7 @@ public class CommittedChangesTreeBrowser extends JPanel implements TypeSafeDataP
|
||||
private final MessageBusConnection myConnection;
|
||||
private TreeState myState;
|
||||
|
||||
public CommittedChangesTreeBrowser(final Project project, final List<CommittedChangeList> changeLists) {
|
||||
public CommittedChangesTreeBrowser(final Project project, final List<? extends CommittedChangeList> changeLists) {
|
||||
super(new BorderLayout());
|
||||
|
||||
myProject = project;
|
||||
@@ -226,7 +226,7 @@ public class CommittedChangesTreeBrowser extends JPanel implements TypeSafeDataP
|
||||
mySplitterProportionsData.externalizeToDimensionService("CommittedChanges.SplitterProportions");
|
||||
}
|
||||
|
||||
public void setItems(@NotNull List<CommittedChangeList> items, final CommittedChangesBrowserUseCase useCase) {
|
||||
public void setItems(@NotNull List<? extends CommittedChangeList> items, final CommittedChangesBrowserUseCase useCase) {
|
||||
myDetailsView.setUseCase(useCase);
|
||||
myChangeLists = new ArrayList<>(items);
|
||||
myFilteringStrategy.setFilterBase(items);
|
||||
@@ -487,7 +487,7 @@ public class CommittedChangesTreeBrowser extends JPanel implements TypeSafeDataP
|
||||
updateModel();
|
||||
}
|
||||
|
||||
public void append(final List<CommittedChangeList> list) {
|
||||
public void append(final List<? extends CommittedChangeList> list) {
|
||||
final TreeState state = myChangeLists.isEmpty() && myState != null ? myState :
|
||||
TreeState.createOn(myChangesTree, (DefaultMutableTreeNode)myChangesTree.getModel().getRoot());
|
||||
state.setScrollToSelection(false);
|
||||
|
||||
+5
-5
@@ -15,7 +15,7 @@ public class CommittedListsSequencesZipper {
|
||||
|
||||
@NotNull private final VcsCommittedListsZipper myVcsPartner;
|
||||
@NotNull private final List<RepositoryLocation> myInLocations;
|
||||
@NotNull private final Map<String, List<CommittedChangeList>> myInLists;
|
||||
@NotNull private final Map<String, List<? extends CommittedChangeList>> myInLists;
|
||||
@NotNull private final Comparator<CommittedChangeList> myComparator;
|
||||
|
||||
public CommittedListsSequencesZipper(@NotNull VcsCommittedListsZipper vcsPartner) {
|
||||
@@ -25,7 +25,7 @@ public class CommittedListsSequencesZipper {
|
||||
myComparator = (o1, o2) -> Comparing.compare(myVcsPartner.getNumber(o1), myVcsPartner.getNumber(o2));
|
||||
}
|
||||
|
||||
public void add(@NotNull RepositoryLocation location, @NotNull List<CommittedChangeList> lists) {
|
||||
public void add(@NotNull RepositoryLocation location, @NotNull List<? extends CommittedChangeList> lists) {
|
||||
myInLocations.add(location);
|
||||
Collections.sort(lists, myComparator);
|
||||
myInLists.put(location.toPresentableString(), lists);
|
||||
@@ -45,8 +45,8 @@ public class CommittedListsSequencesZipper {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private List<List<CommittedChangeList>> collectChangeLists(@NotNull List<RepositoryLocation> locations) {
|
||||
List<List<CommittedChangeList>> result = new ArrayList<>(locations.size());
|
||||
private List<List<? extends CommittedChangeList>> collectChangeLists(@NotNull List<? extends RepositoryLocation> locations) {
|
||||
List<List<? extends CommittedChangeList>> result = new ArrayList<>(locations.size());
|
||||
|
||||
for (RepositoryLocation location : locations) {
|
||||
result.add(myInLists.get(location.toPresentableString()));
|
||||
@@ -77,7 +77,7 @@ public class CommittedListsSequencesZipper {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private CommittedChangeList zip(@NotNull RepositoryLocationGroup group, @NotNull List<CommittedChangeList> equalLists) {
|
||||
private CommittedChangeList zip(@NotNull RepositoryLocationGroup group, @NotNull List<? extends CommittedChangeList> equalLists) {
|
||||
if (equalLists.isEmpty()) {
|
||||
throw new IllegalArgumentException("equalLists can not be empty");
|
||||
}
|
||||
|
||||
+6
-6
@@ -30,17 +30,17 @@ public class CompositeChangeListFilteringStrategy implements ChangeListFiltering
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFilterBase(final List<CommittedChangeList> changeLists) {
|
||||
public void setFilterBase(final List<? extends CommittedChangeList> changeLists) {
|
||||
setFilterBaseImpl(changeLists, true);
|
||||
}
|
||||
|
||||
private List<CommittedChangeList> setFilterBaseImpl(final List<CommittedChangeList> changeLists, final boolean setFirst) {
|
||||
private List<CommittedChangeList> setFilterBaseImpl(final List<? extends CommittedChangeList> changeLists, final boolean setFirst) {
|
||||
List<CommittedChangeList> list = new ArrayList<>(changeLists);
|
||||
if (myInSetBase) {
|
||||
return changeLists;
|
||||
return list;
|
||||
}
|
||||
myInSetBase = true;
|
||||
|
||||
List<CommittedChangeList> list = new ArrayList<>(changeLists);
|
||||
boolean callSetFilterBase = setFirst;
|
||||
for (final ChangeListFilteringStrategy delegate : myDelegates.values()) {
|
||||
if (callSetFilterBase) {
|
||||
@@ -77,7 +77,7 @@ public class CompositeChangeListFilteringStrategy implements ChangeListFiltering
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appendFilterBase(final List<CommittedChangeList> changeLists) {
|
||||
public void appendFilterBase(final List<? extends CommittedChangeList> changeLists) {
|
||||
List<CommittedChangeList> list = new ArrayList<>(changeLists);
|
||||
for (final ChangeListFilteringStrategy delegate : myDelegates.values()) {
|
||||
delegate.appendFilterBase(list);
|
||||
@@ -87,7 +87,7 @@ public class CompositeChangeListFilteringStrategy implements ChangeListFiltering
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public List<CommittedChangeList> filterChangeLists(final List<CommittedChangeList> changeLists) {
|
||||
public List<CommittedChangeList> filterChangeLists(final List<? extends CommittedChangeList> changeLists) {
|
||||
return setFilterBaseImpl(changeLists, false);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -85,7 +85,7 @@ public class CompositeCommittedChangesProvider implements CommittedChangesProvid
|
||||
public void loadCommittedChanges(CompositeChangeBrowserSettings settings,
|
||||
RepositoryLocation location,
|
||||
int maxCount,
|
||||
AsynchConsumer<CommittedChangeList> consumer) {
|
||||
AsynchConsumer<? super CommittedChangeList> consumer) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -89,7 +89,7 @@ public class RootsCalculator {
|
||||
return myLocationCache.getLocation(myVcs, getFilePath(file), false);
|
||||
}
|
||||
|
||||
private static void logRoots(@NotNull String prefix, @NotNull Collection<VirtualFile> roots) {
|
||||
private static void logRoots(@NotNull String prefix, @NotNull Collection<? extends VirtualFile> roots) {
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug(prefix + ": " + join(roots, VirtualFile::getPath, ", "));
|
||||
}
|
||||
|
||||
+4
-4
@@ -64,7 +64,7 @@ public class StructureFilteringStrategy implements ChangeListFilteringStrategy {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFilterBase(List<CommittedChangeList> changeLists) {
|
||||
public void setFilterBase(List<? extends CommittedChangeList> changeLists) {
|
||||
// todo cycle here
|
||||
if (myUI == null) {
|
||||
myUI = new MyUI();
|
||||
@@ -89,15 +89,15 @@ public class StructureFilteringStrategy implements ChangeListFilteringStrategy {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appendFilterBase(List<CommittedChangeList> changeLists) {
|
||||
public void appendFilterBase(List<? extends CommittedChangeList> changeLists) {
|
||||
myUI.append(changeLists);
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public List<CommittedChangeList> filterChangeLists(List<CommittedChangeList> changeLists) {
|
||||
public List<CommittedChangeList> filterChangeLists(List<? extends CommittedChangeList> changeLists) {
|
||||
if (mySelection.size() == 0) {
|
||||
return changeLists;
|
||||
return ContainerUtil.immutableList(changeLists);
|
||||
}
|
||||
final ArrayList<CommittedChangeList> result = new ArrayList<>();
|
||||
for (CommittedChangeList list : changeLists) {
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ public class ApplyPatchDefaultExecutor implements ApplyPatchExecutor<AbstractFil
|
||||
public void apply(@NotNull List<? extends FilePatch> remaining, @NotNull MultiMap<VirtualFile, AbstractFilePatchInProgress> patchGroupsToApply,
|
||||
@Nullable LocalChangeList localList,
|
||||
@Nullable String fileName,
|
||||
@Nullable ThrowableComputable<Map<String, Map<String, CharSequence>>, PatchSyntaxException> additionalInfo) {
|
||||
@Nullable ThrowableComputable<? extends Map<String, Map<String, CharSequence>>, PatchSyntaxException> additionalInfo) {
|
||||
final CommitContext commitContext = new CommitContext();
|
||||
applyAdditionalInfoBefore(myProject, additionalInfo, commitContext);
|
||||
final Collection<PatchApplier> appliers = getPatchAppliers(patchGroupsToApply, localList, commitContext);
|
||||
|
||||
+1
-1
@@ -38,5 +38,5 @@ public interface ApplyPatchExecutor<T extends AbstractFilePatchInProgress> {
|
||||
void apply(@NotNull List<? extends FilePatch> remaining, @NotNull final MultiMap<VirtualFile, T> patchGroupsToApply,
|
||||
@Nullable final LocalChangeList localList,
|
||||
@Nullable String fileName,
|
||||
@Nullable ThrowableComputable<Map<String, Map<String, CharSequence>>, PatchSyntaxException> additionalInfo);
|
||||
@Nullable ThrowableComputable<? extends Map<String, Map<String, CharSequence>>, PatchSyntaxException> additionalInfo);
|
||||
}
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ public class ImportToShelfExecutor implements ApplyPatchExecutor<TextFilePatchIn
|
||||
public void apply(@NotNull List<? extends FilePatch> remaining, @NotNull final MultiMap<VirtualFile, TextFilePatchInProgress> patchGroupsToApply,
|
||||
@Nullable LocalChangeList localList,
|
||||
@Nullable final String fileName,
|
||||
@Nullable ThrowableComputable<Map<String, Map<String, CharSequence>>, PatchSyntaxException> additionalInfo) {
|
||||
@Nullable ThrowableComputable<? extends Map<String, Map<String, CharSequence>>, PatchSyntaxException> additionalInfo) {
|
||||
if (fileName == null) {
|
||||
LOG.error("Patch file name shouldn't be null");
|
||||
return;
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ public class UnshelvePatchDefaultExecutor extends ApplyPatchDefaultExecutor {
|
||||
@NotNull MultiMap<VirtualFile, AbstractFilePatchInProgress> patchGroupsToApply,
|
||||
@Nullable LocalChangeList localList,
|
||||
@Nullable String fileName,
|
||||
@Nullable ThrowableComputable<Map<String, Map<String, CharSequence>>, PatchSyntaxException> additionalInfo) {
|
||||
@Nullable ThrowableComputable<? extends Map<String, Map<String, CharSequence>>, PatchSyntaxException> additionalInfo) {
|
||||
final CommitContext commitContext = new CommitContext();
|
||||
applyAdditionalInfoBefore(myProject, additionalInfo, commitContext);
|
||||
final Collection<PatchApplier> appliers = getPatchAppliers(patchGroupsToApply, localList, commitContext);
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ public class ShelfFileProcessorUtil {
|
||||
public static void savePatchFile(@Nullable Project project,
|
||||
@NotNull File patchFile,
|
||||
List<? extends FilePatch> patches,
|
||||
@Nullable List<PatchEP> extensions,
|
||||
@Nullable List<? extends PatchEP> extensions,
|
||||
@NotNull CommitContext context) throws IOException {
|
||||
try (Writer writer = new OutputStreamWriter(new FileOutputStream(patchFile), StandardCharsets.UTF_8)) {
|
||||
UnifiedDiffWriter.write(project, patches, writer, "\n", chooseNotNull(extensions, UnifiedDiffWriter.getPatchExtensions(project)), context);
|
||||
|
||||
+3
-3
@@ -243,15 +243,15 @@ public class ShelvedChangesViewManager implements Disposable {
|
||||
super(ShelvedChangesViewManager.this.myProject, myTree.getGrouping());
|
||||
}
|
||||
|
||||
public void setShelvedLists(@NotNull List<ShelvedChangeList> shelvedLists) {
|
||||
public void setShelvedLists(@NotNull List<? extends ShelvedChangeList> shelvedLists) {
|
||||
createShelvedListsWithChangesNode(shelvedLists, myRoot);
|
||||
}
|
||||
|
||||
public void setDeletedShelvedLists(@NotNull List<ShelvedChangeList> shelvedLists) {
|
||||
public void setDeletedShelvedLists(@NotNull List<? extends ShelvedChangeList> shelvedLists) {
|
||||
createShelvedListsWithChangesNode(shelvedLists, createTagNode("Recently Deleted"));
|
||||
}
|
||||
|
||||
private void createShelvedListsWithChangesNode(@NotNull List<ShelvedChangeList> shelvedLists, @NotNull MutableTreeNode parentNode) {
|
||||
private void createShelvedListsWithChangesNode(@NotNull List<? extends ShelvedChangeList> shelvedLists, @NotNull MutableTreeNode parentNode) {
|
||||
shelvedLists.forEach(changeList -> {
|
||||
List<ShelvedWrapper> shelvedChanges = new ArrayList<>();
|
||||
requireNonNull(changeList.getChanges()).stream().map(ShelvedWrapper::new).forEach(shelvedChanges::add);
|
||||
|
||||
@@ -43,7 +43,7 @@ public class LocalChangesUnderRoots {
|
||||
myVcsManager = projectLevelVcsManager;
|
||||
}
|
||||
|
||||
public Map<String, Map<VirtualFile, Collection<Change>>> getChangesByLists(@NotNull Collection<VirtualFile> rootsToSave) {
|
||||
public Map<String, Map<VirtualFile, Collection<Change>>> getChangesByLists(@NotNull Collection<? extends VirtualFile> rootsToSave) {
|
||||
final Map<String, Map<VirtualFile, Collection<Change>>> result = new HashMap<>();
|
||||
myRoots = myVcsManager.getAllVcsRoots();
|
||||
|
||||
@@ -63,7 +63,7 @@ public class LocalChangesUnderRoots {
|
||||
* @return a map, whose keys are VCS roots (from the specified list) and values are {@link Change changes} from these roots.
|
||||
*/
|
||||
@NotNull
|
||||
public Map<VirtualFile, Collection<Change>> getChangesUnderRoots(@NotNull Collection<VirtualFile> rootsToSave) {
|
||||
public Map<VirtualFile, Collection<Change>> getChangesUnderRoots(@NotNull Collection<? extends VirtualFile> rootsToSave) {
|
||||
Map<VirtualFile, Collection<Change>> result = new HashMap<>();
|
||||
final Collection<Change> allChanges = myChangeManager.getAllChanges();
|
||||
myRoots = myVcsManager.getAllVcsRoots();
|
||||
@@ -72,7 +72,7 @@ public class LocalChangesUnderRoots {
|
||||
return result;
|
||||
}
|
||||
|
||||
private void addChangesToMap(Collection<VirtualFile> rootsToSave,
|
||||
private void addChangesToMap(Collection<? extends VirtualFile> rootsToSave,
|
||||
Map<VirtualFile, Collection<Change>> result,
|
||||
Collection<? extends Change> allChanges) {
|
||||
for (Change change : allChanges) {
|
||||
@@ -85,13 +85,13 @@ public class LocalChangesUnderRoots {
|
||||
}
|
||||
}
|
||||
|
||||
private void addChangeToMap(@NotNull Map<VirtualFile, Collection<Change>> result, @NotNull Change change, @NotNull ContentRevision revision, @NotNull Collection<VirtualFile> rootsToSave) {
|
||||
private void addChangeToMap(@NotNull Map<VirtualFile, Collection<Change>> result, @NotNull Change change, @NotNull ContentRevision revision, @NotNull Collection<? extends VirtualFile> rootsToSave) {
|
||||
VirtualFile root = getRootForPath(revision.getFile(), rootsToSave);
|
||||
addChangeToMap(result, root, change);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private VirtualFile getRootForPath(@NotNull FilePath file, @NotNull Collection<VirtualFile> rootsToSave) {
|
||||
private VirtualFile getRootForPath(@NotNull FilePath file, @NotNull Collection<? extends VirtualFile> rootsToSave) {
|
||||
final VirtualFile vf = ChangesUtil.findValidParentUnderReadAction(file);
|
||||
if (vf == null) {
|
||||
return null;
|
||||
|
||||
@@ -481,7 +481,7 @@ public class ProjectLevelVcsManagerImpl extends ProjectLevelVcsManagerEx impleme
|
||||
setAutoDirectoryMappings(ContainerUtil.append(myMappings.getDirectoryMappings(), new VcsDirectoryMapping(path, activeVcsName)));
|
||||
}
|
||||
|
||||
public void setAutoDirectoryMappings(@NotNull List<VcsDirectoryMapping> mappings) {
|
||||
public void setAutoDirectoryMappings(@NotNull List<? extends VcsDirectoryMapping> mappings) {
|
||||
myMappings.setDirectoryMappings(mappings);
|
||||
myMappings.cleanupMappings();
|
||||
}
|
||||
|
||||
+4
-4
@@ -524,11 +524,11 @@ public class NewMappings implements Disposable {
|
||||
}
|
||||
|
||||
private static class MyVcsActivator {
|
||||
@NotNull private final Collection<AbstractVcs> myAddVcses;
|
||||
@NotNull private final Collection<AbstractVcs> myRemoveVcses;
|
||||
@NotNull private final Collection<? extends AbstractVcs> myAddVcses;
|
||||
@NotNull private final Collection<? extends AbstractVcs> myRemoveVcses;
|
||||
|
||||
private MyVcsActivator(@NotNull Collection<AbstractVcs> addVcses,
|
||||
@NotNull Collection<AbstractVcs> removeVcses) {
|
||||
private MyVcsActivator(@NotNull Collection<? extends AbstractVcs> addVcses,
|
||||
@NotNull Collection<? extends AbstractVcs> removeVcses) {
|
||||
myAddVcses = addVcses;
|
||||
myRemoveVcses = removeVcses;
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ public class VcsRootDetectorImpl implements VcsRootDetector {
|
||||
return roots;
|
||||
}
|
||||
|
||||
private static boolean shouldScanAbove(@NotNull VirtualFile startDir, @NotNull Set<VcsRoot> rootsInsideDir) {
|
||||
private static boolean shouldScanAbove(@NotNull VirtualFile startDir, @NotNull Set<? extends VcsRoot> rootsInsideDir) {
|
||||
return rootsInsideDir.stream().noneMatch(it -> startDir.equals(it.getPath()));
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ public class FlatSpeedSearchPopup extends PopupFactoryImpl.ActionGroupPopup {
|
||||
public FlatSpeedSearchPopup(String title,
|
||||
@NotNull ActionGroup actionGroup,
|
||||
@NotNull DataContext dataContext,
|
||||
@Nullable Condition<AnAction> preselectActionCondition, boolean showDisableActions) {
|
||||
@Nullable Condition<? super AnAction> preselectActionCondition, boolean showDisableActions) {
|
||||
super(title, actionGroup, dataContext, false, false, showDisableActions, false,
|
||||
null, -1, preselectActionCondition, null);
|
||||
}
|
||||
|
||||
+1
-1
@@ -613,7 +613,7 @@ public abstract class AbstractCommonUpdateAction extends AbstractVcsAction imple
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean showsCustomNotification(@NotNull Collection<AbstractVcs> vcss) {
|
||||
public static boolean showsCustomNotification(@NotNull Collection<? extends AbstractVcs> vcss) {
|
||||
return ContainerUtil.all(vcss, vcs -> {
|
||||
UpdateEnvironment environment = vcs.getUpdateEnvironment();
|
||||
return environment != null && environment.hasCustomNotification();
|
||||
|
||||
@@ -66,7 +66,7 @@ public class UpdateInfoTree extends PanelWithActionsAndCloseButton {
|
||||
private boolean myCanGroupByChangeList = false;
|
||||
private boolean myGroupByChangeList = false;
|
||||
private JLabel myLoadingChangeListsLabel;
|
||||
private List<CommittedChangeList> myCommittedChangeLists;
|
||||
private List<? extends CommittedChangeList> myCommittedChangeLists;
|
||||
private final JPanel myCenterPanel = new JPanel(new CardLayout());
|
||||
@NonNls private static final String CARD_STATUS = "Status";
|
||||
@NonNls private static final String CARD_CHANGES = "Changes";
|
||||
@@ -368,7 +368,7 @@ public class UpdateInfoTree extends PanelWithActionsAndCloseButton {
|
||||
}
|
||||
}
|
||||
|
||||
public void setChangeLists(final List<CommittedChangeList> receivedChanges) {
|
||||
public void setChangeLists(final List<? extends CommittedChangeList> receivedChanges) {
|
||||
final boolean hasEmptyCaches = CommittedChangesCache.getInstance(myProject).hasEmptyCaches();
|
||||
|
||||
ApplicationManager.getApplication().invokeLater(() -> {
|
||||
|
||||
@@ -17,11 +17,11 @@ import java.util.*;
|
||||
|
||||
public abstract class BranchPopupBuilder {
|
||||
@NotNull protected final VcsLogDataPack myDataPack;
|
||||
@Nullable private final Collection<VirtualFile> myVisibleRoots;
|
||||
@Nullable private final Collection<? extends VirtualFile> myVisibleRoots;
|
||||
@Nullable private final List<? extends List<String>> myRecentItems;
|
||||
|
||||
protected BranchPopupBuilder(@NotNull VcsLogDataPack dataPack,
|
||||
@Nullable Collection<VirtualFile> visibleRoots,
|
||||
@Nullable Collection<? extends VirtualFile> visibleRoots,
|
||||
@Nullable List<? extends List<String>> recentItems) {
|
||||
myDataPack = dataPack;
|
||||
myVisibleRoots = visibleRoots;
|
||||
@@ -48,7 +48,7 @@ public abstract class BranchPopupBuilder {
|
||||
}
|
||||
|
||||
private static Groups prepareGroups(@NotNull VcsLogDataPack dataPack,
|
||||
@Nullable Collection<VirtualFile> visibleRoots,
|
||||
@Nullable Collection<? extends VirtualFile> visibleRoots,
|
||||
@Nullable List<? extends List<String>> recentItems) {
|
||||
Groups filteredGroups = new Groups();
|
||||
Collection<VcsRef> allRefs = dataPack.getRefs().getBranches();
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ public class MockCommittedChangesProvider implements CachingCommittedChangesProv
|
||||
public void loadCommittedChanges(ChangeBrowserSettings settings,
|
||||
RepositoryLocation location,
|
||||
int maxCount,
|
||||
AsynchConsumer<CommittedChangeList> consumer) {
|
||||
AsynchConsumer<? super CommittedChangeList> consumer) {
|
||||
++ myRefreshCount;
|
||||
for (CommittedChangeListImpl changeList : myChangeLists) {
|
||||
consumer.consume(changeList);
|
||||
|
||||
+1
-1
@@ -213,7 +213,7 @@ public class CvsCommittedChangesProvider implements CachingCommittedChangesProvi
|
||||
public void loadCommittedChanges(ChangeBrowserSettings settings,
|
||||
RepositoryLocation location,
|
||||
int maxCount,
|
||||
final AsynchConsumer<CommittedChangeList> consumer)
|
||||
final AsynchConsumer<? super CommittedChangeList> consumer)
|
||||
throws VcsException {
|
||||
try {
|
||||
final CvsRepositoryLocation cvsLocation = (CvsRepositoryLocation) location;
|
||||
|
||||
@@ -33,12 +33,12 @@ final class GitTaskHandler extends DvcsTaskHandler<GitRepository> {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void checkout(@NotNull String taskName, @NotNull List<GitRepository> repos, @Nullable Runnable callInAwtLater) {
|
||||
protected void checkout(@NotNull String taskName, @NotNull List<? extends GitRepository> repos, @Nullable Runnable callInAwtLater) {
|
||||
myBrancher.checkout(taskName, false, repos, callInAwtLater);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void checkoutAsNewBranch(@NotNull String name, @NotNull List<GitRepository> repositories) {
|
||||
protected void checkoutAsNewBranch(@NotNull String name, @NotNull List<? extends GitRepository> repositories) {
|
||||
myBrancher.checkoutNewBranch(name, repositories);
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ final class GitTaskHandler extends DvcsTaskHandler<GitRepository> {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mergeAndClose(@NotNull String branch, @NotNull List<GitRepository> repositories) {
|
||||
protected void mergeAndClose(@NotNull String branch, @NotNull List<? extends GitRepository> repositories) {
|
||||
myBrancher.merge(branch, GitBrancher.DeleteOnMergeOption.DELETE, repositories);
|
||||
}
|
||||
|
||||
|
||||
@@ -1083,7 +1083,7 @@ public class GitUtil {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static Map<GitRepository, Hash> getCurrentRevisions(@NotNull Collection<GitRepository> repositories) {
|
||||
public static Map<GitRepository, Hash> getCurrentRevisions(@NotNull Collection<? extends GitRepository> repositories) {
|
||||
Map<GitRepository, Hash> result = new LinkedHashMap<>();
|
||||
for (GitRepository repository : repositories) {
|
||||
String currentRevision = repository.getCurrentRevision();
|
||||
|
||||
@@ -111,7 +111,7 @@ public abstract class BasicAction extends DumbAwareAction {
|
||||
* @param file the file whose children should be added to the result list
|
||||
* (recursively)
|
||||
*/
|
||||
private void addChildren(@NotNull final Project project, @NotNull final List<VirtualFile> files, @NotNull VirtualFile file) {
|
||||
private void addChildren(@NotNull final Project project, @NotNull final List<? super VirtualFile> files, @NotNull VirtualFile file) {
|
||||
VfsUtilCore.visitChildrenRecursively(file, new VirtualFileVisitor(SKIP_ROOT, null) {
|
||||
@Override
|
||||
public boolean visitFile(@NotNull VirtualFile file) {
|
||||
|
||||
@@ -78,7 +78,7 @@ public class GitAdd extends ScheduleForAdditionAction {
|
||||
!toAdd.isEmpty() ? (indicator, exceptions) -> addPathsToVcs(project, toAdd, exceptions) : null);
|
||||
}
|
||||
|
||||
private static void addPathsToVcs(@NotNull Project project, @NotNull Collection<FilePath> toAdd, @NotNull List<VcsException> exceptions) {
|
||||
private static void addPathsToVcs(@NotNull Project project, @NotNull Collection<? extends FilePath> toAdd, @NotNull List<? super VcsException> exceptions) {
|
||||
VcsUtil.groupByRoots(project, toAdd, identity()).forEach((vcsRoot, paths) -> {
|
||||
try {
|
||||
if (!(vcsRoot.getVcs() instanceof GitVcs)) return;
|
||||
@@ -96,7 +96,7 @@ public class GitAdd extends ScheduleForAdditionAction {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static Stream<FilePath> collectPathsFromChanges(@NotNull Project project, @NotNull Stream<Change> allChanges) {
|
||||
private static Stream<FilePath> collectPathsFromChanges(@NotNull Project project, @NotNull Stream<? extends Change> allChanges) {
|
||||
ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(project);
|
||||
|
||||
return allChanges
|
||||
@@ -109,7 +109,7 @@ public class GitAdd extends ScheduleForAdditionAction {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static Stream<FilePath> collectPathsFromFiles(@NotNull Project project, @NotNull Stream<VirtualFile> allFiles) {
|
||||
private static Stream<FilePath> collectPathsFromFiles(@NotNull Project project, @NotNull Stream<? extends VirtualFile> allFiles) {
|
||||
ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(project);
|
||||
ChangeListManager changeListManager = ChangeListManager.getInstance(project);
|
||||
|
||||
|
||||
@@ -184,7 +184,7 @@ abstract class GitMergeAction extends GitRepositoryAction {
|
||||
}
|
||||
|
||||
private static void showUpdates(@NotNull Project project,
|
||||
@NotNull List<VcsException> exceptions,
|
||||
@NotNull List<? super VcsException> exceptions,
|
||||
@NotNull VirtualFile root,
|
||||
@NotNull GitRevisionNumber currentRev,
|
||||
@NotNull Label beforeLabel,
|
||||
|
||||
@@ -47,7 +47,7 @@ public abstract class GitRepositoryAction extends DumbAwareAction {
|
||||
|
||||
@NotNull
|
||||
@CalledInAwt
|
||||
private static VirtualFile getDefaultRoot(@NotNull Project project, @NotNull List<VirtualFile> roots, @Nullable VirtualFile[] vFiles) {
|
||||
private static VirtualFile getDefaultRoot(@NotNull Project project, @NotNull List<? extends VirtualFile> roots, @Nullable VirtualFile[] vFiles) {
|
||||
if (vFiles != null) {
|
||||
for (VirtualFile file : vFiles) {
|
||||
GitRepository repository = GitRepositoryManager.getInstance(project).getRepositoryForFile(file);
|
||||
|
||||
@@ -86,8 +86,8 @@ public class DeepCompareAction extends ToggleAction implements DumbAware {
|
||||
|
||||
private static void selectBranchAndPerformAction(@NotNull VcsLogUi ui,
|
||||
@NotNull AnActionEvent event,
|
||||
@NotNull Consumer<String> consumer,
|
||||
@NotNull Collection<VirtualFile> visibleRoots) {
|
||||
@NotNull Consumer<? super String> consumer,
|
||||
@NotNull Collection<? extends VirtualFile> visibleRoots) {
|
||||
VcsLogDataPack dataPack = ui.getDataPack();
|
||||
ActionGroup actionGroup = new BranchPopupBuilder(dataPack, visibleRoots, null) {
|
||||
@NotNull
|
||||
@@ -139,7 +139,7 @@ public class DeepCompareAction extends ToggleAction implements DumbAware {
|
||||
return ContainerUtil.filter(VcsLogUtil.getVisibleRoots(ui), root -> isGitRoot(project, root));
|
||||
}
|
||||
|
||||
private static boolean hasGitRoots(@NotNull Project project, @NotNull Set<VirtualFile> roots) {
|
||||
private static boolean hasGitRoots(@NotNull Project project, @NotNull Set<? extends VirtualFile> roots) {
|
||||
return ContainerUtil.exists(roots, root -> isGitRoot(project, root));
|
||||
}
|
||||
|
||||
|
||||
@@ -248,7 +248,7 @@ public class GitBranchIncomingOutgoingManager implements GitRepositoryChangeList
|
||||
@NotNull
|
||||
private Map<GitLocalBranch, Hash> calcBranchesToPullForRemote(@NotNull GitRepository repository,
|
||||
@NotNull GitRemote gitRemote,
|
||||
@NotNull Collection<GitBranchTrackInfo> trackInfoList,
|
||||
@NotNull Collection<? extends GitBranchTrackInfo> trackInfoList,
|
||||
GitAuthenticationMode mode) {
|
||||
Map<GitLocalBranch, Hash> result = new HashMap<>();
|
||||
GitBranchesCollection branchesCollection = repository.getBranches();
|
||||
|
||||
@@ -30,6 +30,7 @@ import com.intellij.openapi.vcs.VcsNotifier;
|
||||
import com.intellij.openapi.vcs.changes.Change;
|
||||
import com.intellij.openapi.vcs.changes.ChangesUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.containers.MultiMap;
|
||||
import git4idea.GitUtil;
|
||||
import git4idea.changes.GitChangeUtils;
|
||||
@@ -68,14 +69,14 @@ abstract class GitBranchOperation {
|
||||
@NotNull private final Collection<GitRepository> myRemainingRepositories;
|
||||
|
||||
protected GitBranchOperation(@NotNull Project project, @NotNull Git git,
|
||||
@NotNull GitBranchUiHandler uiHandler, @NotNull Collection<GitRepository> repositories) {
|
||||
@NotNull GitBranchUiHandler uiHandler, @NotNull Collection<? extends GitRepository> repositories) {
|
||||
myProject = project;
|
||||
myGit = git;
|
||||
myUiHandler = uiHandler;
|
||||
|
||||
myRepositories = getRepositoryManager(project).sortByDependency(repositories);
|
||||
myCurrentHeads = Maps.toMap(repositories, repo -> chooseNotNull(repo.getCurrentBranchName(), repo.getCurrentRevision()));
|
||||
myInitialRevisions = Maps.toMap(repositories, GitRepository::getCurrentRevision);
|
||||
myCurrentHeads = ContainerUtil.newMapFromKeys(repositories.iterator(), repo -> chooseNotNull(repo.getCurrentBranchName(), repo.getCurrentRevision()));
|
||||
myInitialRevisions = ContainerUtil.newMapFromKeys(repositories.iterator(), GitRepository::getCurrentRevision);
|
||||
mySuccessfulRepositories = new ArrayList<>();
|
||||
mySkippedRepositories = new ArrayList<>();
|
||||
myRemainingRepositories = new ArrayList<>(myRepositories);
|
||||
@@ -353,7 +354,7 @@ abstract class GitBranchOperation {
|
||||
* local changes.
|
||||
*/
|
||||
@NotNull
|
||||
Map<GitRepository, List<Change>> collectLocalChangesConflictingWithBranch(@NotNull Collection<GitRepository> repositories,
|
||||
Map<GitRepository, List<Change>> collectLocalChangesConflictingWithBranch(@NotNull Collection<? extends GitRepository> repositories,
|
||||
@NotNull String otherBranch) {
|
||||
Map<GitRepository, List<Change>> changes = new HashMap<>();
|
||||
for (GitRepository repository : repositories) {
|
||||
|
||||
@@ -45,7 +45,7 @@ public interface GitBranchUiHandler {
|
||||
* @param operationName
|
||||
* @param repositories
|
||||
*/
|
||||
void showUnmergedFilesNotification(@NotNull String operationName, @NotNull Collection<GitRepository> repositories);
|
||||
void showUnmergedFilesNotification(@NotNull String operationName, @NotNull Collection<? extends GitRepository> repositories);
|
||||
|
||||
/**
|
||||
* Shows a modal notification about unmerged files preventing an operation, with "Rollback" button.
|
||||
@@ -78,7 +78,7 @@ public interface GitBranchUiHandler {
|
||||
*/
|
||||
@NotNull
|
||||
GitSmartOperationDialog.Choice showSmartOperationDialog(@NotNull Project project,
|
||||
@NotNull List<Change> changes,
|
||||
@NotNull List<? extends Change> changes,
|
||||
@NotNull Collection<String> paths,
|
||||
@NotNull String operation,
|
||||
@Nullable String forceButtonTitle);
|
||||
|
||||
@@ -65,7 +65,7 @@ public class GitBranchUiHandlerImpl implements GitBranchUiHandler {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showUnmergedFilesNotification(@NotNull final String operationName, @NotNull final Collection<GitRepository> repositories) {
|
||||
public void showUnmergedFilesNotification(@NotNull final String operationName, @NotNull final Collection<? extends GitRepository> repositories) {
|
||||
String title = unmergedFilesErrorTitle(operationName);
|
||||
String description = unmergedFilesErrorNotificationDescription(operationName);
|
||||
VcsNotifier.getInstance(myProject).notifyError(title, description,
|
||||
@@ -118,7 +118,7 @@ public class GitBranchUiHandlerImpl implements GitBranchUiHandler {
|
||||
@NotNull
|
||||
@Override
|
||||
public GitSmartOperationDialog.Choice showSmartOperationDialog(@NotNull Project project,
|
||||
@NotNull List<Change> changes,
|
||||
@NotNull List<? extends Change> changes,
|
||||
@NotNull Collection<String> paths,
|
||||
@NotNull String operation,
|
||||
@Nullable String forceButtonTitle) {
|
||||
|
||||
@@ -61,7 +61,7 @@ public class GitBranchUtil {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
static String getCurrentBranchOrRev(@NotNull Collection<GitRepository> repositories) {
|
||||
static String getCurrentBranchOrRev(@NotNull Collection<? extends GitRepository> repositories) {
|
||||
if (repositories.size() > 1) {
|
||||
GitMultiRootBranchConfig multiRootBranchConfig = new GitMultiRootBranchConfig(repositories);
|
||||
String currentBranch = multiRootBranchConfig.getCurrentBranch();
|
||||
@@ -237,7 +237,7 @@ public class GitBranchUtil {
|
||||
*/
|
||||
@Nullable
|
||||
public static GitNewBranchOptions getNewBranchNameFromUser(@NotNull Project project,
|
||||
@NotNull Collection<GitRepository> repositories,
|
||||
@NotNull Collection<? extends GitRepository> repositories,
|
||||
@NotNull String dialogTitle,
|
||||
@Nullable String initialName) {
|
||||
return new GitNewBranchDialog(project, dialogTitle, initialName, GitNewBranchNameValidator.newInstance(repositories)).showAndGetOptions();
|
||||
|
||||
@@ -51,7 +51,7 @@ public final class GitBranchWorker {
|
||||
myUiHandler = uiHandler;
|
||||
}
|
||||
|
||||
public void checkoutNewBranch(@NotNull final String name, @NotNull List<GitRepository> repositories) {
|
||||
public void checkoutNewBranch(@NotNull final String name, @NotNull List<? extends GitRepository> repositories) {
|
||||
updateInfo(repositories);
|
||||
repositories = ContainerUtil.filter(repositories, repository -> {
|
||||
GitLocalBranch currentBranch = repository.getCurrentBranch();
|
||||
@@ -70,7 +70,7 @@ public final class GitBranchWorker {
|
||||
new GitCreateBranchOperation(myProject, myGit, myUiHandler, name, startPoints).execute();
|
||||
}
|
||||
|
||||
public void createNewTag(@NotNull final String name, @NotNull final String reference, @NotNull final List<GitRepository> repositories) {
|
||||
public void createNewTag(@NotNull final String name, @NotNull final String reference, @NotNull final List<? extends GitRepository> repositories) {
|
||||
for (GitRepository repository : repositories) {
|
||||
myGit.createNewTag(repository, name, null, reference);
|
||||
repository.getRepositoryFiles().refreshTagsFiles();
|
||||
@@ -78,23 +78,23 @@ public final class GitBranchWorker {
|
||||
}
|
||||
|
||||
public void checkoutNewBranchStartingFrom(@NotNull String newBranchName, @NotNull String startPoint,
|
||||
@NotNull List<GitRepository> repositories) {
|
||||
@NotNull List<? extends GitRepository> repositories) {
|
||||
updateInfo(repositories);
|
||||
new GitCheckoutOperation(myProject, myGit, myUiHandler, repositories, startPoint, false, true, newBranchName).execute();
|
||||
}
|
||||
|
||||
public void checkout(@NotNull final String reference, boolean detach, @NotNull List<GitRepository> repositories) {
|
||||
public void checkout(@NotNull final String reference, boolean detach, @NotNull List<? extends GitRepository> repositories) {
|
||||
updateInfo(repositories);
|
||||
new GitCheckoutOperation(myProject, myGit, myUiHandler, repositories, reference, detach, false, null).execute();
|
||||
}
|
||||
|
||||
|
||||
public void deleteBranch(@NotNull final String branchName, @NotNull final List<GitRepository> repositories) {
|
||||
public void deleteBranch(@NotNull final String branchName, @NotNull final List<? extends GitRepository> repositories) {
|
||||
updateInfo(repositories);
|
||||
new GitDeleteBranchOperation(myProject, myGit, myUiHandler, repositories, branchName).execute();
|
||||
}
|
||||
|
||||
public void deleteTag(@NotNull final String tagName, @NotNull final List<GitRepository> repositories) {
|
||||
public void deleteTag(@NotNull final String tagName, @NotNull final List<? extends GitRepository> repositories) {
|
||||
updateInfo(repositories);
|
||||
new GitDeleteTagOperation(myProject, myGit, myUiHandler, repositories, tagName).execute();
|
||||
}
|
||||
@@ -104,29 +104,29 @@ public final class GitBranchWorker {
|
||||
new GitDeleteRemoteTagOperation(myProject, myGit, myUiHandler, repositories, tagName).execute();
|
||||
}
|
||||
|
||||
public void deleteRemoteBranch(@NotNull final String branchName, @NotNull final List<GitRepository> repositories) {
|
||||
public void deleteRemoteBranch(@NotNull final String branchName, @NotNull final List<? extends GitRepository> repositories) {
|
||||
updateInfo(repositories);
|
||||
new GitDeleteRemoteBranchOperation(myProject, myGit, myUiHandler, repositories, branchName).execute();
|
||||
}
|
||||
|
||||
public void merge(@NotNull final String branchName, @NotNull final GitBrancher.DeleteOnMergeOption deleteOnMerge,
|
||||
@NotNull final List<GitRepository> repositories) {
|
||||
@NotNull final List<? extends GitRepository> repositories) {
|
||||
updateInfo(repositories);
|
||||
new GitMergeOperation(myProject, myGit, myUiHandler, repositories, branchName, deleteOnMerge).execute();
|
||||
}
|
||||
|
||||
public void rebase(@NotNull List<GitRepository> repositories, @NotNull String branchName) {
|
||||
public void rebase(@NotNull List<? extends GitRepository> repositories, @NotNull String branchName) {
|
||||
updateInfo(repositories);
|
||||
GitRebaseUtils.rebase(myProject, repositories, new GitRebaseParams(branchName), myUiHandler.getProgressIndicator());
|
||||
}
|
||||
|
||||
public void rebaseOnCurrent(@NotNull List<GitRepository> repositories, @NotNull String branchName) {
|
||||
public void rebaseOnCurrent(@NotNull List<? extends GitRepository> repositories, @NotNull String branchName) {
|
||||
updateInfo(repositories);
|
||||
GitRebaseUtils.rebase(myProject, repositories, new GitRebaseParams(branchName, null, "HEAD", false, false),
|
||||
myUiHandler.getProgressIndicator());
|
||||
}
|
||||
|
||||
public void renameBranch(@NotNull String currentName, @NotNull String newName, @NotNull List<GitRepository> repositories) {
|
||||
public void renameBranch(@NotNull String currentName, @NotNull String newName, @NotNull List<? extends GitRepository> repositories) {
|
||||
updateInfo(repositories);
|
||||
new GitRenameBranchOperation(myProject, myGit, myUiHandler, currentName, newName, repositories).execute();
|
||||
}
|
||||
@@ -137,7 +137,7 @@ public final class GitBranchWorker {
|
||||
return GitChangeUtils.getDiffWithWorkingDir(repository.getProject(), repository.getRoot(), branchName, null, true);
|
||||
}
|
||||
|
||||
private static void updateInfo(@NotNull Collection<GitRepository> repositories) {
|
||||
private static void updateInfo(@NotNull Collection<? extends GitRepository> repositories) {
|
||||
for (GitRepository repository : repositories) {
|
||||
repository.update();
|
||||
}
|
||||
|
||||
@@ -44,11 +44,10 @@ public interface GitBrancher {
|
||||
* <p>Doesn't check the name of new branch for validity -
|
||||
* do this before calling this method, otherwise a standard error dialog will be shown.</p>
|
||||
* <p>Equivalent to {@code git checkout <name>}</p>
|
||||
*
|
||||
* @param name name of the new branch to check out.
|
||||
* @param name name of the new branch to check out.
|
||||
* @param repositories repositories to operate on.
|
||||
*/
|
||||
void checkoutNewBranch(@NotNull String name, @NotNull List<GitRepository> repositories);
|
||||
void checkoutNewBranch(@NotNull String name, @NotNull List<? extends GitRepository> repositories);
|
||||
|
||||
/**
|
||||
* Creates new branch without checking it out.
|
||||
@@ -61,14 +60,13 @@ public interface GitBrancher {
|
||||
|
||||
/**
|
||||
* <p>Creates new tag on the selected reference.</p>
|
||||
*
|
||||
* @param name the name of new tag.
|
||||
* @param name the name of new tag.
|
||||
* @param reference the reference which tag will point to.
|
||||
* @param repositories repositories to operate on.
|
||||
* @param callInAwtLater the Runnable that should be called after execution of the method (both successful and unsuccessful).
|
||||
* If given, it will be called in the EDT {@link javax.swing.SwingUtilities#invokeLater(Runnable) later}.
|
||||
* If given, it will be called in the EDT {@link javax.swing.SwingUtilities#invokeLater(Runnable) later}.
|
||||
*/
|
||||
void createNewTag(@NotNull String name, @NotNull String reference, @NotNull List<GitRepository> repositories,
|
||||
void createNewTag(@NotNull String name, @NotNull String reference, @NotNull List<? extends GitRepository> repositories,
|
||||
@Nullable Runnable callInAwtLater);
|
||||
|
||||
/**
|
||||
@@ -83,22 +81,21 @@ public interface GitBrancher {
|
||||
* create a local branch tracking the given remote branch, checkout hash or tag into the detached HEAD.
|
||||
* @param repositories repositories to operate on.
|
||||
* @param callInAwtLater the Runnable that should be called after execution of the method (both successful and unsuccessful).
|
||||
* If given, it will be called in the EDT {@link javax.swing.SwingUtilities#invokeLater(Runnable) later}.
|
||||
* If given, it will be called in the EDT {@link javax.swing.SwingUtilities#invokeLater(Runnable) later}.
|
||||
*/
|
||||
void checkout(@NotNull String reference, boolean detach, @NotNull List<GitRepository> repositories, @Nullable Runnable callInAwtLater);
|
||||
void checkout(@NotNull String reference, boolean detach, @NotNull List<? extends GitRepository> repositories, @Nullable Runnable callInAwtLater);
|
||||
|
||||
/**
|
||||
* Creates and checks out a new local branch starting from the given reference:
|
||||
* {@code git checkout -b <branchname> <start-point>}. <br/>
|
||||
* Provides the "smart checkout" procedure the same as in {@link #checkout(String, boolean, List, Runnable)}.
|
||||
*
|
||||
* @param newBranchName the name of the new local branch.
|
||||
* @param newBranchName the name of the new local branch.
|
||||
* @param startPoint the reference to checkout.
|
||||
* @param repositories repositories to operate on.
|
||||
* @param callInAwtLater the Runnable that should be called after execution of the method (both successful and unsuccessful).
|
||||
* If given, it will be called in the EDT {@link javax.swing.SwingUtilities#invokeLater(Runnable) later}.
|
||||
* If given, it will be called in the EDT {@link javax.swing.SwingUtilities#invokeLater(Runnable) later}.
|
||||
*/
|
||||
void checkoutNewBranchStartingFrom(@NotNull String newBranchName, @NotNull String startPoint, @NotNull List<GitRepository> repositories,
|
||||
void checkoutNewBranchStartingFrom(@NotNull String newBranchName, @NotNull String startPoint, @NotNull List<? extends GitRepository> repositories,
|
||||
@Nullable Runnable callInAwtLater);
|
||||
|
||||
/**
|
||||
@@ -107,62 +104,59 @@ public interface GitBrancher {
|
||||
* <p>If the branch can't be deleted, because it is unmerged neither to the HEAD nor to its upstream,
|
||||
* displays a dialog showing commits that are not merged and proposing to execute force deletion:</p>
|
||||
* <p>{@code git branch -D <name>}</p>
|
||||
*
|
||||
* @param branchName the name of the branch to be deleted.
|
||||
* @param branchName the name of the branch to be deleted.
|
||||
* @param repositories repositories to operate on.
|
||||
*/
|
||||
void deleteBranch(@NotNull String branchName, @NotNull List<GitRepository> repositories);
|
||||
void deleteBranch(@NotNull String branchName, @NotNull List<? extends GitRepository> repositories);
|
||||
|
||||
/**
|
||||
* <p>Deletes the remote branch:</p>
|
||||
* <p>{@code git push <remote> :<name>}</p>
|
||||
*
|
||||
* @param branchName name of the remote branch to delete.
|
||||
* @param branchName name of the remote branch to delete.
|
||||
* @param repositories Repositories to operate on.
|
||||
*/
|
||||
void deleteRemoteBranch(@NotNull String branchName, @NotNull List<GitRepository> repositories);
|
||||
void deleteRemoteBranch(@NotNull String branchName, @NotNull List<? extends GitRepository> repositories);
|
||||
|
||||
/**
|
||||
* Compares commits from the HEAD with the specified branch.
|
||||
*/
|
||||
void compare(@NotNull String branchName, @NotNull List<GitRepository> repositories, @NotNull GitRepository selectedRepository);
|
||||
void compare(@NotNull String branchName, @NotNull List<? extends GitRepository> repositories, @NotNull GitRepository selectedRepository);
|
||||
|
||||
/**
|
||||
* Compares the current working tree with its state in the selected branch.
|
||||
*/
|
||||
void showDiffWithLocal(@NotNull String branchName, @NotNull List<GitRepository> repositories);
|
||||
void showDiffWithLocal(@NotNull String branchName, @NotNull List<? extends GitRepository> repositories);
|
||||
|
||||
/**
|
||||
* <p>Merges the given branch to the HEAD.</p>
|
||||
* <p>{@code git merge <name>}</p>
|
||||
* <p>If local changes prevent merging, proposes the "Smart merge" procedure (stash-merge-unstash).</p>
|
||||
* <p>If untracked files prevent merging, shows them in an error dialog.</p>
|
||||
*
|
||||
* @param branchName the branch to be merged into HEAD.
|
||||
* @param branchName the branch to be merged into HEAD.
|
||||
* @param deleteOnMerge specify whether the branch should be automatically deleted or proposed to be deleted after merge.
|
||||
* @param repositories repositories to operate on.
|
||||
*/
|
||||
void merge(@NotNull String branchName, @NotNull DeleteOnMergeOption deleteOnMerge, @NotNull List<GitRepository> repositories);
|
||||
void merge(@NotNull String branchName, @NotNull DeleteOnMergeOption deleteOnMerge, @NotNull List<? extends GitRepository> repositories);
|
||||
|
||||
/**
|
||||
* Call {@code git rebase <branchName>} for each of the given repositories.
|
||||
*/
|
||||
void rebase(@NotNull List<GitRepository> repositories, @NotNull String branchName);
|
||||
void rebase(@NotNull List<? extends GitRepository> repositories, @NotNull String branchName);
|
||||
|
||||
/**
|
||||
* Call {@code git rebase <current branch> <branchName>} for each of the given repositories.
|
||||
*/
|
||||
void rebaseOnCurrent(@NotNull List<GitRepository> repositories, @NotNull String branchName);
|
||||
void rebaseOnCurrent(@NotNull List<? extends GitRepository> repositories, @NotNull String branchName);
|
||||
|
||||
/**
|
||||
* Renames the given branch.
|
||||
*/
|
||||
void renameBranch(@NotNull String currentName, @NotNull String newName, @NotNull List<GitRepository> repositories);
|
||||
void renameBranch(@NotNull String currentName, @NotNull String newName, @NotNull List<? extends GitRepository> repositories);
|
||||
|
||||
/**
|
||||
* Deletes tag
|
||||
*/
|
||||
void deleteTag(@NotNull String name, @NotNull List<GitRepository> repositories);
|
||||
void deleteTag(@NotNull String name, @NotNull List<? extends GitRepository> repositories);
|
||||
|
||||
/**
|
||||
* Deletes tag on all remotes
|
||||
|
||||
@@ -43,7 +43,7 @@ class GitBrancherImpl implements GitBrancher {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkoutNewBranch(@NotNull String name, @NotNull List<GitRepository> repositories) {
|
||||
public void checkoutNewBranch(@NotNull String name, @NotNull List<? extends GitRepository> repositories) {
|
||||
new CommonBackgroundTask(myProject, "Checking out new branch " + name, null) {
|
||||
@Override
|
||||
public void execute(@NotNull ProgressIndicator indicator) {
|
||||
@@ -69,7 +69,7 @@ class GitBrancherImpl implements GitBrancher {
|
||||
|
||||
@Override
|
||||
public void createNewTag(@NotNull String name, @NotNull String reference,
|
||||
@NotNull List<GitRepository> repositories,
|
||||
@NotNull List<? extends GitRepository> repositories,
|
||||
@Nullable Runnable callInAwtLater) {
|
||||
new CommonBackgroundTask(myProject, "Checking out new branch " + name, callInAwtLater) {
|
||||
@Override
|
||||
@@ -82,7 +82,7 @@ class GitBrancherImpl implements GitBrancher {
|
||||
@Override
|
||||
public void checkout(@NotNull String reference,
|
||||
boolean detach,
|
||||
@NotNull List<GitRepository> repositories,
|
||||
@NotNull List<? extends GitRepository> repositories,
|
||||
@Nullable Runnable callInAwtLater) {
|
||||
new CommonBackgroundTask(myProject, "Checking out " + reference, callInAwtLater) {
|
||||
@Override
|
||||
@@ -95,7 +95,7 @@ class GitBrancherImpl implements GitBrancher {
|
||||
@Override
|
||||
public void checkoutNewBranchStartingFrom(@NotNull String newBranchName,
|
||||
@NotNull String startPoint,
|
||||
@NotNull List<GitRepository> repositories,
|
||||
@NotNull List<? extends GitRepository> repositories,
|
||||
@Nullable Runnable callInAwtLater) {
|
||||
new CommonBackgroundTask(myProject, String.format("Checking out %s from %s", newBranchName, startPoint), callInAwtLater) {
|
||||
@Override
|
||||
@@ -106,7 +106,7 @@ class GitBrancherImpl implements GitBrancher {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteBranch(@NotNull String branchName, @NotNull List<GitRepository> repositories) {
|
||||
public void deleteBranch(@NotNull String branchName, @NotNull List<? extends GitRepository> repositories) {
|
||||
new CommonBackgroundTask(myProject, "Deleting " + branchName, null) {
|
||||
@Override
|
||||
public void execute(@NotNull ProgressIndicator indicator) {
|
||||
@@ -116,7 +116,7 @@ class GitBrancherImpl implements GitBrancher {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRemoteBranch(@NotNull String branchName, @NotNull List<GitRepository> repositories) {
|
||||
public void deleteRemoteBranch(@NotNull String branchName, @NotNull List<? extends GitRepository> repositories) {
|
||||
new CommonBackgroundTask(myProject, "Deleting " + branchName, null) {
|
||||
@Override
|
||||
public void execute(@NotNull ProgressIndicator indicator) {
|
||||
@@ -126,7 +126,7 @@ class GitBrancherImpl implements GitBrancher {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void compare(@NotNull String branchName, @NotNull List<GitRepository> repositories,
|
||||
public void compare(@NotNull String branchName, @NotNull List<? extends GitRepository> repositories,
|
||||
@NotNull GitRepository selectedRepository) {
|
||||
VcsLogUtil.runWhenLogIsReady(myProject, (log, logManager) -> {
|
||||
VcsLogRangeFilter filters = VcsLogFilterObject.fromRange("HEAD", branchName);
|
||||
@@ -135,12 +135,12 @@ class GitBrancherImpl implements GitBrancher {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showDiffWithLocal(@NotNull String branchName, @NotNull List<GitRepository> repositories) {
|
||||
public void showDiffWithLocal(@NotNull String branchName, @NotNull List<? extends GitRepository> repositories) {
|
||||
new ShowDiffWithBranchDialog(myProject, branchName, repositories, GitBranchUtil.getCurrentBranchOrRev(repositories)).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void merge(@NotNull String branchName, @NotNull DeleteOnMergeOption deleteOnMerge, @NotNull List<GitRepository> repositories) {
|
||||
public void merge(@NotNull String branchName, @NotNull DeleteOnMergeOption deleteOnMerge, @NotNull List<? extends GitRepository> repositories) {
|
||||
new CommonBackgroundTask(myProject, "Merging " + branchName, null) {
|
||||
@Override
|
||||
public void execute(@NotNull ProgressIndicator indicator) {
|
||||
@@ -150,7 +150,7 @@ class GitBrancherImpl implements GitBrancher {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void rebase(@NotNull List<GitRepository> repositories, @NotNull String branchName) {
|
||||
public void rebase(@NotNull List<? extends GitRepository> repositories, @NotNull String branchName) {
|
||||
new CommonBackgroundTask(myProject, "Rebasing onto " + branchName, null) {
|
||||
@Override
|
||||
void execute(@NotNull ProgressIndicator indicator) {
|
||||
@@ -160,7 +160,7 @@ class GitBrancherImpl implements GitBrancher {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void rebaseOnCurrent(@NotNull List<GitRepository> repositories, @NotNull String branchName) {
|
||||
public void rebaseOnCurrent(@NotNull List<? extends GitRepository> repositories, @NotNull String branchName) {
|
||||
new CommonBackgroundTask(myProject, "Rebasing " + branchName + "...", null) {
|
||||
@Override
|
||||
void execute(@NotNull ProgressIndicator indicator) {
|
||||
@@ -170,7 +170,7 @@ class GitBrancherImpl implements GitBrancher {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renameBranch(@NotNull String currentName, @NotNull String newName, @NotNull List<GitRepository> repositories) {
|
||||
public void renameBranch(@NotNull String currentName, @NotNull String newName, @NotNull List<? extends GitRepository> repositories) {
|
||||
new CommonBackgroundTask(myProject, "Renaming " + currentName + " to " + newName + "...", null) {
|
||||
@Override
|
||||
void execute(@NotNull ProgressIndicator indicator) {
|
||||
@@ -180,7 +180,7 @@ class GitBrancherImpl implements GitBrancher {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteTag(@NotNull String name, @NotNull List<GitRepository> repositories) {
|
||||
public void deleteTag(@NotNull String name, @NotNull List<? extends GitRepository> repositories) {
|
||||
new CommonBackgroundTask(myProject, "Deleting tag " + name, null) {
|
||||
@Override
|
||||
public void execute(@NotNull ProgressIndicator indicator) {
|
||||
|
||||
@@ -38,7 +38,7 @@ class GitCheckoutNewBranchOperation extends GitBranchOperation {
|
||||
@NotNull private final String myNewBranchName;
|
||||
|
||||
GitCheckoutNewBranchOperation(@NotNull Project project, @NotNull Git git, @NotNull GitBranchUiHandler uiHandler,
|
||||
@NotNull Collection<GitRepository> repositories, @NotNull String newBranchName) {
|
||||
@NotNull Collection<? extends GitRepository> repositories, @NotNull String newBranchName) {
|
||||
super(project, git, uiHandler, repositories);
|
||||
myNewBranchName = newBranchName;
|
||||
myProject = project;
|
||||
|
||||
@@ -63,7 +63,7 @@ class GitCheckoutOperation extends GitBranchOperation {
|
||||
GitCheckoutOperation(@NotNull Project project,
|
||||
@NotNull Git git,
|
||||
@NotNull GitBranchUiHandler uiHandler,
|
||||
@NotNull Collection<GitRepository> repositories,
|
||||
@NotNull Collection<? extends GitRepository> repositories,
|
||||
@NotNull String startPointReference,
|
||||
boolean detach,
|
||||
boolean refShouldBeValid,
|
||||
@@ -252,7 +252,7 @@ class GitCheckoutOperation extends GitBranchOperation {
|
||||
}
|
||||
|
||||
// stash - checkout - unstash
|
||||
private boolean smartCheckout(@NotNull final List<GitRepository> repositories, @NotNull final String reference,
|
||||
private boolean smartCheckout(@NotNull final List<? extends GitRepository> repositories, @NotNull final String reference,
|
||||
@Nullable final String newBranch, @NotNull ProgressIndicator indicator) {
|
||||
AtomicBoolean result = new AtomicBoolean();
|
||||
GitPreservingProcess preservingProcess =
|
||||
@@ -265,7 +265,7 @@ class GitCheckoutOperation extends GitBranchOperation {
|
||||
/**
|
||||
* Checks out or shows an error message.
|
||||
*/
|
||||
private boolean checkoutOrNotify(@NotNull List<GitRepository> repositories,
|
||||
private boolean checkoutOrNotify(@NotNull List<? extends GitRepository> repositories,
|
||||
@NotNull String reference, @Nullable String newBranch, boolean force) {
|
||||
GitCompoundResult compoundResult = new GitCompoundResult(myProject);
|
||||
for (GitRepository repository : repositories) {
|
||||
|
||||
@@ -57,7 +57,7 @@ class GitDeleteBranchOperation extends GitBranchOperation {
|
||||
@NotNull private final Map<GitRepository, String> myDeletedBranchTips;
|
||||
|
||||
GitDeleteBranchOperation(@NotNull Project project, @NotNull Git git, @NotNull GitBranchUiHandler uiHandler,
|
||||
@NotNull Collection<GitRepository> repositories, @NotNull String branchName) {
|
||||
@NotNull Collection<? extends GitRepository> repositories, @NotNull String branchName) {
|
||||
super(project, git, uiHandler, repositories);
|
||||
myBranchName = branchName;
|
||||
myNotifier = VcsNotifier.getInstance(myProject);
|
||||
@@ -275,7 +275,7 @@ class GitDeleteBranchOperation extends GitBranchOperation {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static Map<GitRepository, GitRemoteBranch> findTrackedBranches(@NotNull Collection<GitRepository> repositories,
|
||||
private static Map<GitRepository, GitRemoteBranch> findTrackedBranches(@NotNull Collection<? extends GitRepository> repositories,
|
||||
@NotNull String localBranchName) {
|
||||
Map<GitRepository, GitRemoteBranch> trackedBranches = new HashMap<>();
|
||||
for (GitRepository repository : repositories) {
|
||||
|
||||
@@ -44,7 +44,7 @@ class GitDeleteRemoteBranchOperation extends GitBranchOperation {
|
||||
private final String myBranchName;
|
||||
|
||||
GitDeleteRemoteBranchOperation(@NotNull Project project, @NotNull Git git,
|
||||
@NotNull GitBranchUiHandler handler, @NotNull List<GitRepository> repositories,
|
||||
@NotNull GitBranchUiHandler handler, @NotNull List<? extends GitRepository> repositories,
|
||||
@NotNull String name) {
|
||||
super(project, git, handler, repositories);
|
||||
myBranchName = name;
|
||||
@@ -113,11 +113,11 @@ class GitDeleteRemoteBranchOperation extends GitBranchOperation {
|
||||
|
||||
@NotNull
|
||||
private static Collection<String> getCommonTrackingBranches(@NotNull String remoteBranch,
|
||||
@NotNull Collection<GitRepository> repositories) {
|
||||
@NotNull Collection<? extends GitRepository> repositories) {
|
||||
return new GitMultiRootBranchConfig(repositories).getCommonTrackingBranches(remoteBranch);
|
||||
}
|
||||
|
||||
private boolean doDeleteRemote(@NotNull String branchName, @NotNull Collection<GitRepository> repositories) {
|
||||
private boolean doDeleteRemote(@NotNull String branchName, @NotNull Collection<? extends GitRepository> repositories) {
|
||||
Couple<String> pair = splitNameOfRemoteBranch(branchName);
|
||||
String remoteName = pair.getFirst();
|
||||
String branch = pair.getSecond();
|
||||
|
||||
@@ -41,7 +41,7 @@ class GitDeleteTagOperation extends GitBranchOperation {
|
||||
@NotNull private final Map<GitRepository, String> myDeletedTagTips = new HashMap<>();
|
||||
|
||||
GitDeleteTagOperation(@NotNull Project project, @NotNull Git git, @NotNull GitBranchUiHandler uiHandler,
|
||||
@NotNull Collection<GitRepository> repositories, @NotNull String tagName) {
|
||||
@NotNull Collection<? extends GitRepository> repositories, @NotNull String tagName) {
|
||||
super(project, git, uiHandler, repositories);
|
||||
myTagName = tagName;
|
||||
myNotifier = VcsNotifier.getInstance(myProject);
|
||||
|
||||
@@ -45,7 +45,7 @@ class GitMergeOperation extends GitBranchOperation {
|
||||
private GitPreservingProcess myPreservingProcess;
|
||||
|
||||
GitMergeOperation(@NotNull Project project, @NotNull Git git, @NotNull GitBranchUiHandler uiHandler,
|
||||
@NotNull Collection<GitRepository> repositories,
|
||||
@NotNull Collection<? extends GitRepository> repositories,
|
||||
@NotNull String branchToMerge, GitBrancher.DeleteOnMergeOption deleteOnMerge) {
|
||||
super(project, git, uiHandler, repositories);
|
||||
myBranchToMerge = branchToMerge;
|
||||
@@ -195,7 +195,7 @@ class GitMergeOperation extends GitBranchOperation {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean doSmartMerge(@NotNull final Collection<GitRepository> repositories) {
|
||||
private boolean doSmartMerge(@NotNull final Collection<? extends GitRepository> repositories) {
|
||||
final AtomicBoolean success = new AtomicBoolean();
|
||||
myPreservingProcess = new GitPreservingProcess(myProject, myGit, GitUtil.getRootsFromRepositories(repositories), "merge",
|
||||
myBranchToMerge, STASH, getIndicator(),
|
||||
@@ -213,7 +213,7 @@ class GitMergeOperation extends GitBranchOperation {
|
||||
* @return true if merge has succeeded without errors (but possibly with conflicts) in all repositories;
|
||||
* false if it failed at least in one of them.
|
||||
*/
|
||||
private boolean doMerge(@NotNull Collection<GitRepository> repositories) {
|
||||
private boolean doMerge(@NotNull Collection<? extends GitRepository> repositories) {
|
||||
for (GitRepository repository : repositories) {
|
||||
GitSimpleEventDetector mergeConflict = new GitSimpleEventDetector(GitSimpleEventDetector.Event.MERGE_CONFLICT);
|
||||
GitCommandResult result = myGit.merge(repository, myBranchToMerge, Collections.emptyList(), mergeConflict);
|
||||
@@ -279,7 +279,7 @@ class GitMergeOperation extends GitBranchOperation {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private GitCompoundResult smartRollback(@NotNull Collection<GitRepository> repositories) {
|
||||
private GitCompoundResult smartRollback(@NotNull Collection<? extends GitRepository> repositories) {
|
||||
LOG.info("Starting smart rollback...");
|
||||
final GitCompoundResult result = new GitCompoundResult(myProject);
|
||||
Collection<VirtualFile> roots = GitUtil.getRootsFromRepositories(repositories);
|
||||
|
||||
@@ -36,7 +36,7 @@ public class GitRenameBranchOperation extends GitBranchOperation {
|
||||
@NotNull GitBranchUiHandler uiHandler,
|
||||
@NotNull String currentName,
|
||||
@NotNull String newName,
|
||||
@NotNull List<GitRepository> repositories) {
|
||||
@NotNull List<? extends GitRepository> repositories) {
|
||||
super(project, git, uiHandler, repositories);
|
||||
myCurrentName = currentName;
|
||||
myNewName = newName;
|
||||
|
||||
@@ -72,7 +72,7 @@ public class GitSmartOperationDialog extends DialogWrapper {
|
||||
*/
|
||||
@NotNull
|
||||
static Choice show(@NotNull Project project,
|
||||
@NotNull List<Change> changes,
|
||||
@NotNull List<? extends Change> changes,
|
||||
@NotNull Collection<String> paths,
|
||||
@NotNull String operationTitle,
|
||||
@Nullable String forceButtonTitle) {
|
||||
|
||||
@@ -17,7 +17,7 @@ import javax.swing.JComponent
|
||||
|
||||
internal class ShowDiffWithBranchDialog(val project: Project,
|
||||
val branchName: String,
|
||||
val repositories: MutableList<GitRepository>,
|
||||
val repositories: List<GitRepository>,
|
||||
val currentBranchName: String) : DialogWrapper(project, true) {
|
||||
|
||||
init {
|
||||
|
||||
@@ -63,7 +63,7 @@ public class GitChangeUtils {
|
||||
@Nullable GitRevisionNumber thisRevision,
|
||||
GitRevisionNumber parentRevision,
|
||||
String s,
|
||||
Collection<Change> changes,
|
||||
Collection<? super Change> changes,
|
||||
final Set<String> ignoreNames) throws VcsException {
|
||||
StringScanner sc = new StringScanner(s);
|
||||
parseChanges(project, vcsRoot, thisRevision, parentRevision, sc, changes, ignoreNames);
|
||||
@@ -89,7 +89,7 @@ public class GitChangeUtils {
|
||||
@Nullable GitRevisionNumber thisRevision,
|
||||
@Nullable GitRevisionNumber parentRevision,
|
||||
StringScanner s,
|
||||
Collection<Change> changes,
|
||||
Collection<? super Change> changes,
|
||||
final Set<String> ignoreNames) throws VcsException {
|
||||
while (s.hasMoreData()) {
|
||||
FileStatus status = null;
|
||||
@@ -220,7 +220,7 @@ public class GitChangeUtils {
|
||||
|
||||
@Nullable
|
||||
public static Hash commitExists(final Project project, final VirtualFile root, final String anyReference,
|
||||
List<VirtualFile> paths, final String... parameters) {
|
||||
List<? extends VirtualFile> paths, final String... parameters) {
|
||||
GitLineHandler h = new GitLineHandler(project, root, GitCommand.LOG);
|
||||
h.setSilent(true);
|
||||
h.addParameters(parameters);
|
||||
@@ -324,7 +324,7 @@ public class GitChangeUtils {
|
||||
@NotNull VirtualFile root,
|
||||
@Nullable String oldRevision,
|
||||
@Nullable String newRevision,
|
||||
@Nullable Collection<FilePath> dirtyPaths) throws VcsException {
|
||||
@Nullable Collection<? extends FilePath> dirtyPaths) throws VcsException {
|
||||
return getDiff(project, root, oldRevision, newRevision, dirtyPaths, true);
|
||||
}
|
||||
|
||||
@@ -333,7 +333,7 @@ public class GitChangeUtils {
|
||||
@NotNull VirtualFile root,
|
||||
@Nullable String oldRevision,
|
||||
@Nullable String newRevision,
|
||||
@Nullable Collection<FilePath> dirtyPaths,
|
||||
@Nullable Collection<? extends FilePath> dirtyPaths,
|
||||
boolean detectRenames) throws VcsException {
|
||||
LOG.assertTrue(oldRevision != null || newRevision != null, "Both old and new revisions can't be null");
|
||||
String range;
|
||||
@@ -419,7 +419,7 @@ public class GitChangeUtils {
|
||||
public static Collection<Change> getDiffWithWorkingDir(@NotNull Project project,
|
||||
@NotNull VirtualFile root,
|
||||
@NotNull String oldRevision,
|
||||
@Nullable Collection<FilePath> dirtyPaths,
|
||||
@Nullable Collection<? extends FilePath> dirtyPaths,
|
||||
boolean reverse) throws VcsException {
|
||||
return getDiffWithWorkingDir(project, root, oldRevision, dirtyPaths, reverse, true);
|
||||
}
|
||||
@@ -428,7 +428,7 @@ public class GitChangeUtils {
|
||||
public static Collection<Change> getDiffWithWorkingDir(@NotNull Project project,
|
||||
@NotNull VirtualFile root,
|
||||
@NotNull String oldRevision,
|
||||
@Nullable Collection<FilePath> dirtyPaths,
|
||||
@Nullable Collection<? extends FilePath> dirtyPaths,
|
||||
boolean reverse,
|
||||
boolean detectRenames) throws VcsException {
|
||||
String output = getDiffOutput(project, root, oldRevision, dirtyPaths, reverse, detectRenames);
|
||||
@@ -453,7 +453,7 @@ public class GitChangeUtils {
|
||||
private static String getDiffOutput(@NotNull Project project,
|
||||
@NotNull VirtualFile root,
|
||||
@NotNull String diffRange,
|
||||
@Nullable Collection<FilePath> dirtyPaths,
|
||||
@Nullable Collection<? extends FilePath> dirtyPaths,
|
||||
boolean reverse,
|
||||
boolean detectRenames)
|
||||
throws VcsException {
|
||||
@@ -470,7 +470,7 @@ public class GitChangeUtils {
|
||||
private static GitLineHandler getDiffHandler(@NotNull Project project,
|
||||
@NotNull VirtualFile root,
|
||||
@NotNull String diffRange,
|
||||
@Nullable Collection<FilePath> dirtyPaths,
|
||||
@Nullable Collection<? extends FilePath> dirtyPaths,
|
||||
boolean reverse,
|
||||
boolean detectRenames) {
|
||||
GitLineHandler handler = new GitLineHandler(project, root, GitCommand.DIFF);
|
||||
|
||||
@@ -27,7 +27,6 @@ import com.intellij.vcsUtil.VcsUtil;
|
||||
import git4idea.*;
|
||||
import git4idea.history.GitFileHistory;
|
||||
import git4idea.history.GitHistoryUtils;
|
||||
import git4idea.history.GitLogUtil;
|
||||
import git4idea.repo.GitRepository;
|
||||
import git4idea.repo.GitRepositoryManager;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -84,7 +83,7 @@ public class GitCommittedChangeListProvider implements CommittedChangesProvider<
|
||||
|
||||
@Override
|
||||
public void loadCommittedChanges(ChangeBrowserSettings settings, RepositoryLocation location, int maxCount,
|
||||
final AsynchConsumer<CommittedChangeList> consumer) throws VcsException {
|
||||
final AsynchConsumer<? super CommittedChangeList> consumer) throws VcsException {
|
||||
try {
|
||||
getCommittedChangesImpl(settings, location, maxCount, gitCommittedChangeList -> consumer.consume(gitCommittedChangeList));
|
||||
}
|
||||
@@ -105,7 +104,7 @@ public class GitCommittedChangeListProvider implements CommittedChangesProvider<
|
||||
}
|
||||
|
||||
private void getCommittedChangesImpl(ChangeBrowserSettings settings, RepositoryLocation location, final int maxCount,
|
||||
final Consumer<GitCommittedChangeList> consumer)
|
||||
final Consumer<? super GitCommittedChangeList> consumer)
|
||||
throws VcsException {
|
||||
GitRepositoryLocation l = (GitRepositoryLocation)location;
|
||||
final Long beforeRev = settings.getChangeBeforeFilter();
|
||||
|
||||
@@ -73,7 +73,7 @@ public class GitOutgoingChangesProvider implements VcsOutgoingChangesProvider<Co
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Change> filterLocalChangesBasedOnLocalCommits(final Collection<Change> localChanges, final VirtualFile vcsRoot)
|
||||
public Collection<Change> filterLocalChangesBasedOnLocalCommits(final Collection<? extends Change> localChanges, final VirtualFile vcsRoot)
|
||||
throws VcsException {
|
||||
final GitBranchesSearcher searcher = new GitBranchesSearcher(myProject, vcsRoot, true);
|
||||
if (searcher.getLocal() == null || searcher.getRemote() == null) {
|
||||
|
||||
@@ -562,10 +562,10 @@ public class GitCheckinEnvironment implements CheckinEnvironment, AmendCommitAwa
|
||||
return files;
|
||||
}
|
||||
|
||||
private static void processExcludedPaths(@NotNull Collection<Change> changes,
|
||||
private static void processExcludedPaths(@NotNull Collection<? extends Change> changes,
|
||||
@NotNull Set<FilePath> added,
|
||||
@NotNull Set<FilePath> removed,
|
||||
@NotNull PairConsumer<FilePath, FilePath> function) {
|
||||
@NotNull PairConsumer<? super FilePath, ? super FilePath> function) {
|
||||
for (Change change : changes) {
|
||||
FilePath before = getBeforePath(change);
|
||||
FilePath after = getAfterPath(change);
|
||||
@@ -946,7 +946,7 @@ public class GitCheckinEnvironment implements CheckinEnvironment, AmendCommitAwa
|
||||
*/
|
||||
private static boolean updateIndex(final Project project,
|
||||
final VirtualFile root,
|
||||
final Collection<FilePath> added,
|
||||
final Collection<? extends FilePath> added,
|
||||
final Collection<? extends FilePath> removed,
|
||||
final List<? super VcsException> exceptions) {
|
||||
boolean rc = true;
|
||||
|
||||
@@ -199,7 +199,7 @@ public class GitCheckinHandlerFactory extends VcsCheckinHandlerFactory {
|
||||
|
||||
@NotNull
|
||||
private static Map<VirtualFile, Couple<String>> getDefinedUserNames(@NotNull final Project project,
|
||||
@NotNull final Collection<VirtualFile> roots,
|
||||
@NotNull final Collection<? extends VirtualFile> roots,
|
||||
final boolean stopWhenFoundFirst) {
|
||||
final Map<VirtualFile, Couple<String>> defined = new HashMap<>();
|
||||
ProgressManager.getInstance().run(new Task.Modal(project, "Checking Git User Name...", true) {
|
||||
@@ -228,7 +228,7 @@ public class GitCheckinHandlerFactory extends VcsCheckinHandlerFactory {
|
||||
}
|
||||
|
||||
private boolean setUserNameUnderProgress(@NotNull final Project project,
|
||||
@NotNull final Collection<VirtualFile> notDefined,
|
||||
@NotNull final Collection<? extends VirtualFile> notDefined,
|
||||
@NotNull final GitUserNameNotDefinedDialog dialog) {
|
||||
final Ref<String> error = Ref.create();
|
||||
ProgressManager.getInstance().run(new Task.Modal(project, "Setting Git User Name...", true) {
|
||||
|
||||
@@ -48,7 +48,7 @@ public interface Git {
|
||||
* make sure to supply a stateless constructor.
|
||||
*/
|
||||
@NotNull
|
||||
GitCommandResult runCommand(@NotNull Computable<GitLineHandler> handlerConstructor);
|
||||
GitCommandResult runCommand(@NotNull Computable<? extends GitLineHandler> handlerConstructor);
|
||||
|
||||
/**
|
||||
* A generic method to run a Git command, when existing methods are not sufficient. <br/>
|
||||
@@ -72,14 +72,14 @@ public interface Git {
|
||||
GitCommandResult init(@NotNull Project project, @NotNull VirtualFile root, @NotNull GitLineHandlerListener... listeners);
|
||||
|
||||
@NotNull
|
||||
Set<VirtualFile> ignoredFiles(@NotNull Project project, @NotNull VirtualFile root, @Nullable Collection<FilePath> paths) throws VcsException;
|
||||
Set<VirtualFile> ignoredFiles(@NotNull Project project, @NotNull VirtualFile root, @Nullable Collection<? extends FilePath> paths) throws VcsException;
|
||||
|
||||
@NotNull
|
||||
Set<VirtualFile> ignoredFilesNoChunk(@NotNull Project project, @NotNull VirtualFile root, @Nullable List<String> paths) throws VcsException;
|
||||
|
||||
@NotNull
|
||||
Set<VirtualFile> untrackedFiles(@NotNull Project project, @NotNull VirtualFile root,
|
||||
@Nullable Collection<VirtualFile> files) throws VcsException;
|
||||
@Nullable Collection<? extends VirtualFile> files) throws VcsException;
|
||||
|
||||
// relativePaths are guaranteed to fit into command line length limitations.
|
||||
@NotNull
|
||||
@@ -182,7 +182,7 @@ public interface Git {
|
||||
|
||||
@NotNull
|
||||
GitCommandResult checkAttr(@NotNull GitRepository repository, @NotNull Collection<String> attributes,
|
||||
@NotNull Collection<VirtualFile> files);
|
||||
@NotNull Collection<? extends VirtualFile> files);
|
||||
|
||||
@NotNull
|
||||
GitCommandResult stashSave(@NotNull GitRepository repository, @NotNull String message);
|
||||
@@ -193,7 +193,7 @@ public interface Git {
|
||||
@NotNull
|
||||
GitCommandResult fetch(@NotNull GitRepository repository,
|
||||
@NotNull GitRemote remote,
|
||||
@NotNull List<GitLineHandlerListener> listeners,
|
||||
@NotNull List<? extends GitLineHandlerListener> listeners,
|
||||
String... params);
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -58,7 +58,7 @@ public abstract class GitHandler {
|
||||
private boolean myStdoutSuppressed; // If true, the standard output is not copied to version control console
|
||||
private boolean myStderrSuppressed; // If true, the standard error is not copied to version control console
|
||||
|
||||
@Nullable private ThrowableConsumer<OutputStream, IOException> myInputProcessor; // The processor for stdin
|
||||
@Nullable private ThrowableConsumer<? super OutputStream, IOException> myInputProcessor; // The processor for stdin
|
||||
|
||||
private final EventDispatcher<ProcessEventListener> myListeners = EventDispatcher.create(ProcessEventListener.class);
|
||||
protected boolean mySilent; // if true, the command execution is not logged in version control view
|
||||
@@ -222,7 +222,7 @@ public abstract class GitHandler {
|
||||
addRelativePaths(Arrays.asList(parameters));
|
||||
}
|
||||
|
||||
public void addRelativePaths(@NotNull Collection<FilePath> filePaths) {
|
||||
public void addRelativePaths(@NotNull Collection<? extends FilePath> filePaths) {
|
||||
for (FilePath path : filePaths) {
|
||||
if (path instanceof RemoteFilePath) {
|
||||
myCommandLine.addParameter(path.getPath());
|
||||
@@ -233,7 +233,7 @@ public abstract class GitHandler {
|
||||
}
|
||||
}
|
||||
|
||||
public void addRelativeFiles(@NotNull final Collection<VirtualFile> files) {
|
||||
public void addRelativeFiles(@NotNull final Collection<? extends VirtualFile> files) {
|
||||
for (VirtualFile file : files) {
|
||||
myCommandLine.addParameter(VcsFileUtil.relativePath(getWorkingDirectory(), file));
|
||||
}
|
||||
@@ -342,7 +342,7 @@ public abstract class GitHandler {
|
||||
*
|
||||
* @param inputProcessor the processor
|
||||
*/
|
||||
public void setInputProcessor(@Nullable ThrowableConsumer<OutputStream, IOException> inputProcessor) {
|
||||
public void setInputProcessor(@Nullable ThrowableConsumer<? super OutputStream, IOException> inputProcessor) {
|
||||
myInputProcessor = inputProcessor;
|
||||
}
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ class GitHttpGuiAuthenticator implements GitHttpAuthenticator {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private ProviderAndData acquireData(@NotNull String unifiedUrl, @NotNull Function<AuthDataProvider, AuthData> dataAcquirer) {
|
||||
private ProviderAndData acquireData(@NotNull String unifiedUrl, @NotNull Function<? super AuthDataProvider, ? extends AuthData> dataAcquirer) {
|
||||
return myAuthenticationGate.waitAndCompute(() -> {
|
||||
try {
|
||||
for (AuthDataProvider provider : getProviders(unifiedUrl)) {
|
||||
|
||||
@@ -63,7 +63,7 @@ public class GitImpl extends GitImplBase {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<VirtualFile> ignoredFiles(@NotNull Project project, @NotNull VirtualFile root, @Nullable Collection<FilePath> paths)
|
||||
public Set<VirtualFile> ignoredFiles(@NotNull Project project, @NotNull VirtualFile root, @Nullable Collection<? extends FilePath> paths)
|
||||
throws VcsException {
|
||||
Set<VirtualFile> ignoredFiles = new HashSet<>();
|
||||
|
||||
@@ -132,7 +132,7 @@ public class GitImpl extends GitImplBase {
|
||||
@Override
|
||||
@NotNull
|
||||
public Set<VirtualFile> untrackedFiles(@NotNull Project project, @NotNull VirtualFile root,
|
||||
@Nullable Collection<VirtualFile> files) throws VcsException {
|
||||
@Nullable Collection<? extends VirtualFile> files) throws VcsException {
|
||||
final Set<VirtualFile> untrackedFiles = new HashSet<>();
|
||||
|
||||
if (files == null) {
|
||||
@@ -211,7 +211,7 @@ public class GitImpl extends GitImplBase {
|
||||
@Override
|
||||
public GitCommandResult checkAttr(@NotNull final GitRepository repository,
|
||||
@NotNull final Collection<String> attributes,
|
||||
@NotNull Collection<VirtualFile> files) {
|
||||
@NotNull Collection<? extends VirtualFile> files) {
|
||||
List<String> relativeFilePaths = ContainerUtil.map(files, file -> VcsFileUtil.relativePath(repository.getRoot(), file));
|
||||
|
||||
final GitLineHandler h = new GitLineHandler(repository.getProject(), repository.getRoot(), GitCommand.CHECK_ATTR);
|
||||
@@ -459,7 +459,7 @@ public class GitImpl extends GitImplBase {
|
||||
final boolean force,
|
||||
final boolean updateTracking,
|
||||
final boolean skipHook,
|
||||
final List<GitPushParams.ForceWithLease> forceWithLease,
|
||||
final List<? extends GitPushParams.ForceWithLease> forceWithLease,
|
||||
@Nullable final String tagMode,
|
||||
@NotNull final GitLineHandlerListener... listeners) {
|
||||
return runCommand(() -> {
|
||||
@@ -555,7 +555,7 @@ public class GitImpl extends GitImplBase {
|
||||
@NotNull
|
||||
public GitCommandResult fetch(@NotNull final GitRepository repository,
|
||||
@NotNull final GitRemote remote,
|
||||
@NotNull final List<GitLineHandlerListener> listeners,
|
||||
@NotNull final List<? extends GitLineHandlerListener> listeners,
|
||||
final String... params) {
|
||||
return fetch(repository, remote, listeners, null, params);
|
||||
}
|
||||
@@ -563,7 +563,7 @@ public class GitImpl extends GitImplBase {
|
||||
@NotNull
|
||||
public GitCommandResult fetch(@NotNull final GitRepository repository,
|
||||
@NotNull final GitRemote remote,
|
||||
@NotNull final List<GitLineHandlerListener> listeners,
|
||||
@NotNull final List<? extends GitLineHandlerListener> listeners,
|
||||
@Nullable GitAuthenticationGate authenticationGate,
|
||||
final String... params) {
|
||||
return runCommand(() -> {
|
||||
@@ -781,7 +781,7 @@ public class GitImpl extends GitImplBase {
|
||||
addListeners(handler, asList(listeners));
|
||||
}
|
||||
|
||||
private static void addListeners(@NotNull GitLineHandler handler, @NotNull List<GitLineHandlerListener> listeners) {
|
||||
private static void addListeners(@NotNull GitLineHandler handler, @NotNull List<? extends GitLineHandlerListener> listeners) {
|
||||
for (GitLineHandlerListener listener : listeners) {
|
||||
handler.addLineListener(listener);
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ abstract class GitImplBase implements Git {
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public GitCommandResult runCommand(@NotNull Computable<GitLineHandler> handlerConstructor) {
|
||||
public GitCommandResult runCommand(@NotNull Computable<? extends GitLineHandler> handlerConstructor) {
|
||||
return run(handlerConstructor, GitImplBase::getCollectingCollector);
|
||||
}
|
||||
|
||||
@@ -90,8 +90,8 @@ abstract class GitImplBase implements Git {
|
||||
* Run handler with retry on authentication failure
|
||||
*/
|
||||
@NotNull
|
||||
private GitCommandResult run(@NotNull Computable<GitLineHandler> handlerConstructor,
|
||||
@NotNull Computable<OutputCollector> outputCollectorConstructor) {
|
||||
private GitCommandResult run(@NotNull Computable<? extends GitLineHandler> handlerConstructor,
|
||||
@NotNull Computable<? extends OutputCollector> outputCollectorConstructor) {
|
||||
@NotNull GitCommandResult result;
|
||||
|
||||
int authAttempt = 0;
|
||||
|
||||
@@ -66,8 +66,8 @@ public class GitMergeHandler {
|
||||
windowTitle, Arrays.asList(leftTitle, centerTitle, rightTitle));
|
||||
}
|
||||
|
||||
public void acceptOneVersion(@NotNull Collection<GitConflict> conflicts,
|
||||
@NotNull Collection<VirtualFile> reversedRoots,
|
||||
public void acceptOneVersion(@NotNull Collection<? extends GitConflict> conflicts,
|
||||
@NotNull Collection<? extends VirtualFile> reversedRoots,
|
||||
boolean takeTheirs) throws VcsException {
|
||||
try {
|
||||
MultiMap<VirtualFile, GitConflict> byRoot = groupConflictsByRoot(conflicts);
|
||||
@@ -87,7 +87,7 @@ public class GitMergeHandler {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static MultiMap<VirtualFile, GitConflict> groupConflictsByRoot(@NotNull Collection<GitConflict> conflicts) {
|
||||
public static MultiMap<VirtualFile, GitConflict> groupConflictsByRoot(@NotNull Collection<? extends GitConflict> conflicts) {
|
||||
MultiMap<VirtualFile, GitConflict> byRoot = MultiMap.create();
|
||||
for (GitConflict conflict : conflicts) {
|
||||
byRoot.putValue(conflict.getRoot(), conflict);
|
||||
|
||||
@@ -98,7 +98,7 @@ public class GitCrlfProblemsDetector {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private Collection<VirtualFile> findFilesWithoutAttrs(@NotNull VirtualFile root, @NotNull Collection<VirtualFile> files) {
|
||||
private Collection<VirtualFile> findFilesWithoutAttrs(@NotNull VirtualFile root, @NotNull Collection<? extends VirtualFile> files) {
|
||||
GitRepository repository = myRepositoryManager.getRepositoryForRoot(root);
|
||||
if (repository == null) {
|
||||
LOG.warn("Repository is null for " + root);
|
||||
@@ -142,7 +142,7 @@ public class GitCrlfProblemsDetector {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static Collection<VirtualFile> findFilesWithCrlf(@NotNull Collection<VirtualFile> files) {
|
||||
private static Collection<VirtualFile> findFilesWithCrlf(@NotNull Collection<? extends VirtualFile> files) {
|
||||
Collection<VirtualFile> filesWithCrlf = new ArrayList<>();
|
||||
for (VirtualFile file : files) {
|
||||
ProgressIndicatorProvider.checkCanceled();
|
||||
|
||||
@@ -19,7 +19,6 @@ import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.vcs.FilePath;
|
||||
import com.intellij.openapi.vcs.FileStatus;
|
||||
import com.intellij.openapi.vcs.VcsException;
|
||||
import com.intellij.openapi.vcs.changes.Change;
|
||||
import com.intellij.openapi.vcs.changes.ContentRevision;
|
||||
import com.intellij.openapi.vcs.history.VcsRevisionNumber;
|
||||
@@ -40,7 +39,7 @@ public class GitChangesParser {
|
||||
@NotNull
|
||||
public static List<Change> parse(@NotNull Project project,
|
||||
@NotNull VirtualFile root,
|
||||
@NotNull List<VcsFileStatusInfo> statusInfos,
|
||||
@NotNull List<? extends VcsFileStatusInfo> statusInfos,
|
||||
@NotNull String hash,
|
||||
@NotNull Date date,
|
||||
@Nullable String parentsHash) {
|
||||
@@ -96,7 +95,7 @@ public class GitChangesParser {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static Change.Type getChangeType(@NotNull GitChangeType type) {
|
||||
static Change.Type getChangeType(@NotNull GitChangeType type) {
|
||||
switch (type) {
|
||||
case ADDED:
|
||||
return Change.Type.NEW;
|
||||
|
||||
@@ -155,8 +155,8 @@ public class GitDiffFromHistoryHandler extends BaseDiffFromHistoryHandler<GitFil
|
||||
private void checkIfFileWasTouchedAndFindParentsInBackground(@NotNull final FilePath filePath,
|
||||
@NotNull final GitFileRevision rev,
|
||||
@NotNull final Collection<String> parentHashes,
|
||||
@Nullable final List<VcsFileRevision> revisions,
|
||||
@NotNull final Consumer<MergeCommitPreCheckInfo> resultHandler) {
|
||||
@Nullable final List<? extends VcsFileRevision> revisions,
|
||||
@NotNull final Consumer<? super MergeCommitPreCheckInfo> resultHandler) {
|
||||
new Task.Backgroundable(myProject, "Loading changes...", true) {
|
||||
private MergeCommitPreCheckInfo myInfo;
|
||||
|
||||
@@ -187,7 +187,7 @@ public class GitDiffFromHistoryHandler extends BaseDiffFromHistoryHandler<GitFil
|
||||
private Collection<GitFileRevision> findParentRevisions(@NotNull GitRepository repository,
|
||||
@NotNull GitFileRevision currentRevision,
|
||||
@NotNull Collection<String> parentHashes,
|
||||
@Nullable List<VcsFileRevision> revisions) throws VcsException {
|
||||
@Nullable List<? extends VcsFileRevision> revisions) throws VcsException {
|
||||
// currentRevision is a merge revision.
|
||||
// the file could be renamed in one of the branches, i.e. the name in one of the parent revisions may be different from the name
|
||||
// in currentRevision. It can be different even in both parents, but it would a rename-rename conflict, and we don't handle such anyway.
|
||||
@@ -203,7 +203,7 @@ public class GitDiffFromHistoryHandler extends BaseDiffFromHistoryHandler<GitFil
|
||||
private GitFileRevision createParentRevision(@NotNull GitRepository repository,
|
||||
@NotNull GitFileRevision currentRevision,
|
||||
@NotNull String parentHash,
|
||||
@Nullable List<VcsFileRevision> revisions) throws VcsException {
|
||||
@Nullable List<? extends VcsFileRevision> revisions) throws VcsException {
|
||||
if (revisions != null) {
|
||||
for (VcsFileRevision revision : revisions) {
|
||||
if (((GitFileRevision)revision).getHash().equals(parentHash)) {
|
||||
@@ -235,7 +235,7 @@ public class GitDiffFromHistoryHandler extends BaseDiffFromHistoryHandler<GitFil
|
||||
}
|
||||
|
||||
private void showPopup(@NotNull AnActionEvent event, @NotNull GitFileRevision rev, @NotNull FilePath filePath,
|
||||
@NotNull Collection<GitFileRevision> parents) {
|
||||
@NotNull Collection<? extends GitFileRevision> parents) {
|
||||
ActionGroup parentActions = createActionGroup(rev, filePath, parents);
|
||||
DataContext dataContext = SimpleDataContext.getProjectContext(myProject);
|
||||
ListPopup popup = JBPopupFactory.getInstance().createActionGroupPopup("Choose parent to compare", parentActions, dataContext,
|
||||
@@ -260,7 +260,7 @@ public class GitDiffFromHistoryHandler extends BaseDiffFromHistoryHandler<GitFil
|
||||
@NotNull
|
||||
private ActionGroup createActionGroup(@NotNull GitFileRevision rev,
|
||||
@NotNull FilePath filePath,
|
||||
@NotNull Collection<GitFileRevision> parents) {
|
||||
@NotNull Collection<? extends GitFileRevision> parents) {
|
||||
Collection<AnAction> actions = new ArrayList<>(2);
|
||||
for (GitFileRevision parent : parents) {
|
||||
actions.add(createParentAction(rev, filePath, parent));
|
||||
|
||||
@@ -87,8 +87,8 @@ public class GitFileHistory {
|
||||
myStartingRevision = revision;
|
||||
}
|
||||
|
||||
private void load(@NotNull Consumer<GitFileRevision> consumer,
|
||||
@NotNull Consumer<VcsException> exceptionConsumer,
|
||||
private void load(@NotNull Consumer<? super GitFileRevision> consumer,
|
||||
@NotNull Consumer<? super VcsException> exceptionConsumer,
|
||||
String... parameters) {
|
||||
GitLogParser<GitLogFullRecord> logParser = GitLogParser.createDefaultParser(myProject, GitLogParser.NameStatus.STATUS,
|
||||
HASH, COMMIT_TIME, AUTHOR_NAME, AUTHOR_EMAIL,
|
||||
@@ -198,8 +198,8 @@ public class GitFileHistory {
|
||||
public static void loadHistory(@NotNull Project project,
|
||||
@NotNull FilePath path,
|
||||
@Nullable VcsRevisionNumber startingFrom,
|
||||
@NotNull Consumer<GitFileRevision> consumer,
|
||||
@NotNull Consumer<VcsException> exceptionConsumer,
|
||||
@NotNull Consumer<? super GitFileRevision> consumer,
|
||||
@NotNull Consumer<? super VcsException> exceptionConsumer,
|
||||
String... parameters) {
|
||||
try {
|
||||
VirtualFile repositoryRoot = GitUtil.getRepositoryForFile(project, path).getRoot();
|
||||
@@ -256,9 +256,9 @@ public class GitFileHistory {
|
||||
@NotNull private final AtomicBoolean mySkipFurtherOutput = new AtomicBoolean();
|
||||
@NotNull private final AtomicReference<String> myFirstCommit = new AtomicReference<>();
|
||||
@NotNull private final AtomicReference<FilePath> myCurrentPath = new AtomicReference<>();
|
||||
@NotNull private final Consumer<GitFileRevision> myRevisionConsumer;
|
||||
@NotNull private final Consumer<? super GitFileRevision> myRevisionConsumer;
|
||||
|
||||
GitLogRecordConsumer(@NotNull Consumer<GitFileRevision> revisionConsumer) {
|
||||
GitLogRecordConsumer(@NotNull Consumer<? super GitFileRevision> revisionConsumer) {
|
||||
myRevisionConsumer = revisionConsumer;
|
||||
}
|
||||
|
||||
@@ -276,7 +276,7 @@ public class GitFileHistory {
|
||||
myFirstCommit.set(record.getHash());
|
||||
|
||||
myRevisionConsumer.consume(createGitFileRevision(record));
|
||||
List<VcsFileStatusInfo> statusInfos = record.getStatusInfos();
|
||||
List<? extends VcsFileStatusInfo> statusInfos = record.getStatusInfos();
|
||||
if (statusInfos.isEmpty()) {
|
||||
// can safely be empty, for example, for simple merge commits that don't change anything.
|
||||
return;
|
||||
@@ -293,7 +293,7 @@ public class GitFileHistory {
|
||||
Couple<String> authorPair = Couple.of(record.getAuthorName(), record.getAuthorEmail());
|
||||
Couple<String> committerPair = Couple.of(record.getCommitterName(), record.getCommitterEmail());
|
||||
Collection<String> parents = Arrays.asList(record.getParentsHashes());
|
||||
List<VcsFileStatusInfo> statusInfos = record.getStatusInfos();
|
||||
List<? extends VcsFileStatusInfo> statusInfos = record.getStatusInfos();
|
||||
boolean deleted = !statusInfos.isEmpty() && statusInfos.get(0).getType() == Change.Type.DELETED;
|
||||
return new GitFileRevision(myProject, myRoot, revisionPath, revision, Couple.of(authorPair, committerPair),
|
||||
record.getFullMessage(),
|
||||
|
||||
@@ -75,7 +75,7 @@ public class GitHistoryProvider implements VcsHistoryProviderEx,
|
||||
|
||||
@Override
|
||||
public VcsAbstractHistorySession createFromCachedData(Boolean aBoolean,
|
||||
@NotNull List<VcsFileRevision> revisions,
|
||||
@NotNull List<? extends VcsFileRevision> revisions,
|
||||
@NotNull FilePath filePath,
|
||||
VcsRevisionNumber currentRevision) {
|
||||
return createSession(filePath, revisions, currentRevision);
|
||||
|
||||
@@ -14,10 +14,10 @@ import java.util.*;
|
||||
|
||||
class GitLogFullRecord extends GitLogRecord {
|
||||
|
||||
@NotNull private final List<VcsFileStatusInfo> myStatusInfo;
|
||||
@NotNull private final List<? extends VcsFileStatusInfo> myStatusInfo;
|
||||
|
||||
GitLogFullRecord(@NotNull Map<GitLogParser.GitLogOption, String> options,
|
||||
@NotNull List<VcsFileStatusInfo> statusInfo,
|
||||
@NotNull List<? extends VcsFileStatusInfo> statusInfo,
|
||||
boolean supportsRawBody) {
|
||||
super(options, supportsRawBody);
|
||||
myStatusInfo = statusInfo;
|
||||
@@ -34,7 +34,7 @@ class GitLogFullRecord extends GitLogRecord {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
List<VcsFileStatusInfo> getStatusInfos() {
|
||||
List<? extends VcsFileStatusInfo> getStatusInfos() {
|
||||
return myStatusInfo;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,14 +30,14 @@ abstract class GitLogRecordCollector<R extends GitLogRecord> implements Consumer
|
||||
|
||||
@NotNull protected final Project myProject;
|
||||
@NotNull protected final VirtualFile myRoot;
|
||||
@NotNull protected final Consumer<List<R>> myConsumer;
|
||||
@NotNull protected final Consumer<? super List<R>> myConsumer;
|
||||
|
||||
@NotNull private final MultiMap<String, R> myHashToRecord = MultiMap.createLinked();
|
||||
@Nullable private String myLastHash = null;
|
||||
|
||||
protected GitLogRecordCollector(@NotNull Project project,
|
||||
@NotNull VirtualFile root,
|
||||
@NotNull Consumer<List<R>> consumer) {
|
||||
@NotNull Consumer<? super List<R>> consumer) {
|
||||
myProject = project;
|
||||
myRoot = root;
|
||||
myConsumer = consumer;
|
||||
@@ -115,7 +115,7 @@ abstract class GitLogRecordCollector<R extends GitLogRecord> implements Consumer
|
||||
@NotNull
|
||||
private static <R extends GitLogRecord> Map<String, String> getHashToTreeMap(@NotNull Project project,
|
||||
@NotNull VirtualFile root,
|
||||
@NotNull Collection<R> records)
|
||||
@NotNull Collection<? extends R> records)
|
||||
throws VcsException {
|
||||
Set<String> hashes = new HashSet<>();
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ class GitLogUnorderedRecordCollector extends GitLogRecordCollector<GitCompressed
|
||||
|
||||
protected GitLogUnorderedRecordCollector(@NotNull Project project,
|
||||
@NotNull VirtualFile root,
|
||||
@NotNull Consumer<List<GitCompressedRecord>> consumer) {
|
||||
@NotNull Consumer<? super List<GitCompressedRecord>> consumer) {
|
||||
super(project, root, consumer);
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ public class GitIndexUtil {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static List<StagedFile> listStaged(@NotNull GitRepository repository, @NotNull Collection<FilePath> filePaths) throws VcsException {
|
||||
public static List<StagedFile> listStaged(@NotNull GitRepository repository, @NotNull Collection<? extends FilePath> filePaths) throws VcsException {
|
||||
List<StagedFile> result = new ArrayList<>();
|
||||
VirtualFile root = repository.getRoot();
|
||||
|
||||
@@ -91,7 +91,7 @@ public class GitIndexUtil {
|
||||
|
||||
@NotNull
|
||||
public static List<StagedFileOrDirectory> listTree(@NotNull GitRepository repository,
|
||||
@NotNull Collection<FilePath> filePath,
|
||||
@NotNull Collection<? extends FilePath> filePath,
|
||||
@NotNull VcsRevisionNumber revision) throws VcsException {
|
||||
List<StagedFileOrDirectory> result = new ArrayList<>();
|
||||
VirtualFile root = repository.getRoot();
|
||||
|
||||
@@ -128,7 +128,7 @@ public class GitLogDiffHandler implements VcsLogDiffHandler {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static String getTitleForPaths(@NotNull VirtualFile root, @Nullable Collection<FilePath> filePaths) {
|
||||
private static String getTitleForPaths(@NotNull VirtualFile root, @Nullable Collection<? extends FilePath> filePaths) {
|
||||
if (filePaths == null) return getContentTitle(VcsUtil.getFilePath(root));
|
||||
String joinedPaths = StringUtil.join(filePaths, path -> VcsFileUtil.relativePath(root, path), ", ");
|
||||
return StringUtil.shortenTextWithEllipsis(joinedPaths, 100, 0);
|
||||
@@ -151,7 +151,7 @@ public class GitLogDiffHandler implements VcsLogDiffHandler {
|
||||
|
||||
@NotNull
|
||||
private Collection<Change> getDiff(@NotNull VirtualFile root,
|
||||
@NotNull Collection<FilePath> filePaths,
|
||||
@NotNull Collection<? extends FilePath> filePaths,
|
||||
@NotNull Hash leftRevision,
|
||||
@Nullable Hash rightRevision) throws VcsException {
|
||||
if (rightRevision == null) {
|
||||
@@ -160,8 +160,8 @@ public class GitLogDiffHandler implements VcsLogDiffHandler {
|
||||
return GitChangeUtils.getDiff(myProject, root, leftRevision.asString(), rightRevision.asString(), filePaths);
|
||||
}
|
||||
|
||||
private <T> void loadDiffAndShow(@NotNull ThrowableComputable<T, VcsException> load,
|
||||
@NotNull Consumer<T> show,
|
||||
private <T> void loadDiffAndShow(@NotNull ThrowableComputable<? extends T, VcsException> load,
|
||||
@NotNull Consumer<? super T> show,
|
||||
@NotNull @Nls(capitalization = Nls.Capitalization.Title) String title) {
|
||||
if (ApplicationManager.getApplication().isDispatchThread()) {
|
||||
ProgressManager.getInstance().run(new Task.Backgroundable(myProject, title + "...", false) {
|
||||
|
||||
@@ -116,12 +116,12 @@ public class GitShowExternalLogAction extends DumbAwareAction {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static String calcLogId(@NotNull List<VirtualFile> roots) {
|
||||
private static String calcLogId(@NotNull List<? extends VirtualFile> roots) {
|
||||
return EXTERNAL + " " + StringUtil.join(roots, VirtualFile::getPath, File.pathSeparator);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static String calcTabName(@NotNull ContentManager cm, @NotNull List<VirtualFile> roots) {
|
||||
private static String calcTabName(@NotNull ContentManager cm, @NotNull List<? extends VirtualFile> roots) {
|
||||
String name = VcsLogContentProvider.TAB_NAME + " (" + roots.get(0).getName();
|
||||
if (roots.size() > 1) {
|
||||
name += "+";
|
||||
|
||||
@@ -39,7 +39,7 @@ public class GitConflictResolver {
|
||||
|
||||
private static final Logger LOG = Logger.getInstance(GitConflictResolver.class);
|
||||
|
||||
@NotNull private final Collection<VirtualFile> myRoots;
|
||||
@NotNull private final Collection<? extends VirtualFile> myRoots;
|
||||
@NotNull private final Params myParams;
|
||||
|
||||
@NotNull protected final Project myProject;
|
||||
@@ -107,11 +107,11 @@ public class GitConflictResolver {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public GitConflictResolver(@NotNull Project project, @NotNull Git git, @NotNull Collection<VirtualFile> roots, @NotNull Params params) {
|
||||
public GitConflictResolver(@NotNull Project project, @NotNull Git git, @NotNull Collection<? extends VirtualFile> roots, @NotNull Params params) {
|
||||
this(project, roots, params);
|
||||
}
|
||||
|
||||
public GitConflictResolver(@NotNull Project project, @NotNull Collection<VirtualFile> roots, @NotNull Params params) {
|
||||
public GitConflictResolver(@NotNull Project project, @NotNull Collection<? extends VirtualFile> roots, @NotNull Params params) {
|
||||
myProject = project;
|
||||
myRoots = roots;
|
||||
myParams = params;
|
||||
@@ -222,7 +222,7 @@ public class GitConflictResolver {
|
||||
|
||||
}
|
||||
|
||||
private void showMergeDialog(@NotNull Collection<VirtualFile> initiallyUnmergedFiles) {
|
||||
private void showMergeDialog(@NotNull Collection<? extends VirtualFile> initiallyUnmergedFiles) {
|
||||
TransactionGuard.getInstance().assertWriteSafeContext(ModalityState.defaultModalityState());
|
||||
ApplicationManager.getApplication().invokeAndWait(() -> {
|
||||
MergeProvider mergeProvider = new GitMergeProvider(myProject, myParams.reverse);
|
||||
@@ -243,7 +243,7 @@ public class GitConflictResolver {
|
||||
* @see #getUnmergedFiles(VirtualFile)
|
||||
*/
|
||||
@NotNull
|
||||
private Collection<VirtualFile> getUnmergedFiles(@NotNull Collection<VirtualFile> roots) throws VcsException {
|
||||
private Collection<VirtualFile> getUnmergedFiles(@NotNull Collection<? extends VirtualFile> roots) throws VcsException {
|
||||
final Collection<VirtualFile> unmergedFiles = new HashSet<>();
|
||||
for (VirtualFile root : roots) {
|
||||
unmergedFiles.addAll(getUnmergedFiles(root));
|
||||
|
||||
@@ -27,14 +27,14 @@ import java.util.Collection;
|
||||
* Conflict resolver that makes a merge commit after all conflicts are resolved.
|
||||
*/
|
||||
public class GitMergeCommittingConflictResolver extends GitConflictResolver {
|
||||
private final Collection<VirtualFile> myMergingRoots;
|
||||
private final Collection<? extends VirtualFile> myMergingRoots;
|
||||
private final boolean myRefreshAfterCommit;
|
||||
private final GitMerger myMerger;
|
||||
|
||||
public GitMergeCommittingConflictResolver(@NotNull Project project,
|
||||
@NotNull Git git,
|
||||
@NotNull GitMerger merger,
|
||||
@NotNull Collection<VirtualFile> mergingRoots,
|
||||
@NotNull Collection<? extends VirtualFile> mergingRoots,
|
||||
@NotNull Params params,
|
||||
boolean refreshAfterCommit) {
|
||||
super(project, mergingRoots, params);
|
||||
|
||||
@@ -232,7 +232,7 @@ public class GitMergeProvider implements MergeProvider2 {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void conflictResolvedForFiles(@NotNull List<VirtualFile> files, @NotNull Resolution resolution) {
|
||||
public void conflictResolvedForFiles(@NotNull List<? extends VirtualFile> files, @NotNull Resolution resolution) {
|
||||
MultiMap<VirtualFile, GitConflict> byRoot = groupConflictsByRoot(files);
|
||||
|
||||
for (VirtualFile root : byRoot.keySet()) {
|
||||
@@ -250,7 +250,7 @@ public class GitMergeProvider implements MergeProvider2 {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void acceptFilesRevisions(@NotNull List<VirtualFile> files, @NotNull Resolution resolution) throws VcsException {
|
||||
public void acceptFilesRevisions(@NotNull List<? extends VirtualFile> files, @NotNull Resolution resolution) throws VcsException {
|
||||
assert resolution == Resolution.AcceptedYours || resolution == Resolution.AcceptedTheirs;
|
||||
|
||||
MultiMap<VirtualFile, GitConflict> byRoot = groupConflictsByRoot(files);
|
||||
@@ -273,7 +273,7 @@ public class GitMergeProvider implements MergeProvider2 {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private MultiMap<VirtualFile, GitConflict> groupConflictsByRoot(@NotNull List<VirtualFile> files) {
|
||||
private MultiMap<VirtualFile, GitConflict> groupConflictsByRoot(@NotNull List<? extends VirtualFile> files) {
|
||||
MultiMap<VirtualFile, GitConflict> byRoot = MultiMap.create();
|
||||
for (VirtualFile file: files) {
|
||||
GitConflict c = myConflicts.get(file);
|
||||
|
||||
@@ -411,7 +411,7 @@ public class GitMergeUtil {
|
||||
|
||||
public static void acceptOneVersion(@NotNull Project project,
|
||||
@NotNull VirtualFile root,
|
||||
@NotNull Collection<GitConflict> conflicts,
|
||||
@NotNull Collection<? extends GitConflict> conflicts,
|
||||
@NotNull GitConflict.ConflictSide side) throws VcsException {
|
||||
boolean isCurrent = side == GitConflict.ConflictSide.OURS;
|
||||
|
||||
@@ -446,7 +446,7 @@ public class GitMergeUtil {
|
||||
*/
|
||||
public static void markConflictResolved(@NotNull Project project,
|
||||
@NotNull VirtualFile root,
|
||||
@NotNull Collection<GitConflict> conflicts,
|
||||
@NotNull Collection<? extends GitConflict> conflicts,
|
||||
@Nullable GitConflict.ConflictSide side) throws VcsException {
|
||||
List<FilePath> toAdd = new ArrayList<>();
|
||||
List<FilePath> toDelete = new ArrayList<>();
|
||||
|
||||
@@ -51,7 +51,7 @@ public class GitMerger {
|
||||
repository -> repository.getState() == Repository.State.MERGING));
|
||||
}
|
||||
|
||||
public void mergeCommit(@NotNull Collection<VirtualFile> roots) throws VcsException {
|
||||
public void mergeCommit(@NotNull Collection<? extends VirtualFile> roots) throws VcsException {
|
||||
for (VirtualFile root : roots) {
|
||||
mergeCommit(root);
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ public class MergeChangeCollector {
|
||||
/**
|
||||
* Collects changed files during or after merge operation to the supplied {@code updates} container.
|
||||
*/
|
||||
public void collect(final UpdatedFiles updates, List<VcsException> exceptions) {
|
||||
public void collect(final UpdatedFiles updates, List<? super VcsException> exceptions) {
|
||||
try {
|
||||
// collect unmerged
|
||||
Set<String> paths = getUnmergedPaths();
|
||||
@@ -154,7 +154,7 @@ public class MergeChangeCollector {
|
||||
* Populates the supplied collections of modified, created and removed files returned by 'git diff #revisions' command,
|
||||
* where revisions is the range of revisions to check.
|
||||
*/
|
||||
public void getChangedFilesExceptUnmerged(Collection<String> updated, Collection<String> created, Collection<String> removed, String revisions)
|
||||
public void getChangedFilesExceptUnmerged(Collection<? super String> updated, Collection<? super String> created, Collection<? super String> removed, String revisions)
|
||||
throws VcsException {
|
||||
if (revisions == null) {
|
||||
return;
|
||||
|
||||
@@ -199,7 +199,7 @@ public class GitPushOperation {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private Collection<VirtualFile> findRootsWithMergeCommits(@NotNull Collection<GitRepository> rootsToSearch) {
|
||||
private Collection<VirtualFile> findRootsWithMergeCommits(@NotNull Collection<? extends GitRepository> rootsToSearch) {
|
||||
return ContainerUtil.mapNotNull(rootsToSearch, repo -> {
|
||||
PushSpec<GitPushSource, GitPushTarget> pushSpec = myPushSpecs.get(repo);
|
||||
if (pushSpec == null) { // repository is not selected to be pushed, but can be rebased
|
||||
@@ -271,7 +271,7 @@ public class GitPushOperation {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private Map<GitRepository, GitPushRepoResult> push(@NotNull List<GitRepository> repositories) {
|
||||
private Map<GitRepository, GitPushRepoResult> push(@NotNull List<? extends GitRepository> repositories) {
|
||||
Map<GitRepository, GitPushRepoResult> results = new LinkedHashMap<>();
|
||||
for (GitRepository repository : repositories) {
|
||||
PushSpec<GitPushSource, GitPushTarget> spec = myPushSpecs.get(repository);
|
||||
@@ -313,7 +313,7 @@ public class GitPushOperation {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static GitPushNativeResult getBranchResult(@NotNull List<GitPushNativeResult> results) {
|
||||
private static GitPushNativeResult getBranchResult(@NotNull List<? extends GitPushNativeResult> results) {
|
||||
return ContainerUtil.find(results, result -> result.getSourceRef().startsWith("refs/heads/"));
|
||||
}
|
||||
|
||||
@@ -400,7 +400,7 @@ public class GitPushOperation {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private PushUpdateSettings showDialogAndGetExitCode(@NotNull final Set<GitRepository> repositories,
|
||||
private PushUpdateSettings showDialogAndGetExitCode(@NotNull final Set<? extends GitRepository> repositories,
|
||||
@NotNull final PushUpdateSettings initialSettings,
|
||||
final boolean rebaseOverMergeProblemDetected) {
|
||||
Ref<PushUpdateSettings> updateSettings = Ref.create();
|
||||
@@ -427,7 +427,7 @@ public class GitPushOperation {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
protected GitUpdateResult update(@NotNull Collection<GitRepository> rootsToUpdate,
|
||||
protected GitUpdateResult update(@NotNull Collection<? extends GitRepository> rootsToUpdate,
|
||||
@NotNull UpdateMethod updateMethod,
|
||||
boolean checkForRebaseOverMergeProblem) {
|
||||
GitUpdateProcess updateProcess = new GitUpdateProcess(myProject, myProgressIndicator,
|
||||
|
||||
@@ -191,7 +191,7 @@ class GitAbortRebaseProcess {
|
||||
}).execute();
|
||||
}
|
||||
|
||||
private static void refresh(@NotNull List<GitRepository> toRefresh) {
|
||||
private static void refresh(@NotNull List<? extends GitRepository> toRefresh) {
|
||||
for (GitRepository repository : toRefresh) {
|
||||
repository.update();
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ class GitInteractiveRebaseFile {
|
||||
}
|
||||
}
|
||||
|
||||
public void save(@NotNull List<GitRebaseEntry> entries) throws IOException {
|
||||
public void save(@NotNull List<? extends GitRebaseEntry> entries) throws IOException {
|
||||
String encoding = GitConfigUtil.getLogEncoding(myProject, myRoot);
|
||||
try (PrintWriter out = new PrintWriter(new OutputStreamWriter(new FileOutputStream(myFile), encoding))) {
|
||||
for (GitRebaseEntry e : entries) {
|
||||
|
||||
@@ -347,7 +347,7 @@ public class GitRebaseProcess {
|
||||
((GitSuccessfulRebase)rebaseStatus).getSuccessType() != SuccessType.UP_TO_DATE;
|
||||
}
|
||||
|
||||
private boolean saveDirtyRootsInitially(@NotNull List<GitRepository> repositories) {
|
||||
private boolean saveDirtyRootsInitially(@NotNull List<? extends GitRepository> repositories) {
|
||||
Collection<GitRepository> repositoriesToSave = filter(repositories, repository -> {
|
||||
return !repository.equals(myRebaseSpec.getOngoingRebase()); // no need to save anything when --continue/--skip is to be called
|
||||
});
|
||||
@@ -362,7 +362,7 @@ public class GitRebaseProcess {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private String saveLocalChanges(@NotNull Collection<VirtualFile> rootsToSave) {
|
||||
private String saveLocalChanges(@NotNull Collection<? extends VirtualFile> rootsToSave) {
|
||||
try {
|
||||
mySaver.saveLocalChanges(rootsToSave);
|
||||
return null;
|
||||
@@ -393,12 +393,12 @@ public class GitRebaseProcess {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static String getCommonCurrentBranchNameIfAllTheSame(@NotNull Collection<GitRepository> repositories) {
|
||||
private static String getCommonCurrentBranchNameIfAllTheSame(@NotNull Collection<? extends GitRepository> repositories) {
|
||||
return getItemIfAllTheSame(map(repositories, Repository::getCurrentBranchName), null);
|
||||
}
|
||||
|
||||
@Contract("_, !null -> !null")
|
||||
private static <T> T getItemIfAllTheSame(@NotNull Collection<T> collection, @Nullable T defaultItem) {
|
||||
private static <T> T getItemIfAllTheSame(@NotNull Collection<? extends T> collection, @Nullable T defaultItem) {
|
||||
return new HashSet<>(collection).size() == 1 ? getFirstItem(collection) : defaultItem;
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ public class GitRebaseSpec {
|
||||
@NotNull
|
||||
public static GitRebaseSpec forNewRebase(@NotNull Project project,
|
||||
@NotNull GitRebaseParams params,
|
||||
@NotNull Collection<GitRepository> repositories,
|
||||
@NotNull Collection<? extends GitRepository> repositories,
|
||||
@NotNull ProgressIndicator indicator) {
|
||||
GitUtil.updateRepositories(repositories);
|
||||
Map<GitRepository, String> initialHeadPositions = findInitialHeadPositions(repositories, params.getBranch());
|
||||
@@ -147,7 +147,7 @@ public class GitRebaseSpec {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static Map<GitRepository, String> findInitialHeadPositions(@NotNull Collection<GitRepository> repositories,
|
||||
private static Map<GitRepository, String> findInitialHeadPositions(@NotNull Collection<? extends GitRepository> repositories,
|
||||
@Nullable final String branchToCheckout) {
|
||||
return ContainerUtil.map2Map(repositories, repository -> {
|
||||
String currentRevision = findCurrentRevision(repository, branchToCheckout);
|
||||
@@ -177,7 +177,7 @@ public class GitRebaseSpec {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static Map<GitRepository, String> findInitialBranchNames(@NotNull Collection<GitRepository> repositories) {
|
||||
private static Map<GitRepository, String> findInitialBranchNames(@NotNull Collection<? extends GitRepository> repositories) {
|
||||
return ContainerUtil.map2Map(repositories, repository -> {
|
||||
String currentBranchName = repository.getCurrentBranchName();
|
||||
LOG.debug("Current branch in [" + repository.getRoot().getName() + "] is [" + currentBranchName + "]");
|
||||
|
||||
@@ -44,7 +44,7 @@ public class GitRebaseUtils {
|
||||
}
|
||||
|
||||
public static void rebase(@NotNull final Project project,
|
||||
@NotNull final List<GitRepository> repositories,
|
||||
@NotNull final List<? extends GitRepository> repositories,
|
||||
@NotNull final GitRebaseParams params,
|
||||
@NotNull final ProgressIndicator indicator) {
|
||||
if (!isRebaseAllowed(project, repositories)) return; // TODO maybe move to the outside
|
||||
@@ -121,7 +121,7 @@ public class GitRebaseUtils {
|
||||
Collections.emptyMap(), indicator, null, true).abortWithConfirmation();
|
||||
}
|
||||
|
||||
private static boolean isRebaseAllowed(@NotNull Project project, @NotNull Collection<GitRepository> repositories) {
|
||||
private static boolean isRebaseAllowed(@NotNull Project project, @NotNull Collection<? extends GitRepository> repositories) {
|
||||
// TODO links to 'rebase', 'resolve conflicts', etc.
|
||||
for (GitRepository repository : repositories) {
|
||||
Repository.State state = repository.getState();
|
||||
|
||||
@@ -112,7 +112,7 @@ public class GitRebaser {
|
||||
* Runs 'git rebase --continue' on several roots consequently.
|
||||
* @return true if rebase successfully finished.
|
||||
*/
|
||||
public boolean continueRebase(@NotNull Collection<VirtualFile> rebasingRoots) {
|
||||
public boolean continueRebase(@NotNull Collection<? extends VirtualFile> rebasingRoots) {
|
||||
try (AccessToken ignore = DvcsUtil.workingTreeChangeStarted(myProject, "Rebase")) {
|
||||
boolean success = true;
|
||||
for (VirtualFile root : rebasingRoots) {
|
||||
|
||||
@@ -45,12 +45,12 @@ public class GitConfig {
|
||||
private static final Pattern BRANCH_INFO_SECTION = Pattern.compile("branch \"(.*)\"", Pattern.CASE_INSENSITIVE);
|
||||
private static final Pattern BRANCH_COMMON_PARAMS_SECTION = Pattern.compile("branch", Pattern.CASE_INSENSITIVE);
|
||||
|
||||
@NotNull private final Collection<Remote> myRemotes;
|
||||
@NotNull private final Collection<Url> myUrls;
|
||||
@NotNull private final Collection<BranchConfig> myTrackedInfos;
|
||||
@NotNull private final Collection<? extends Remote> myRemotes;
|
||||
@NotNull private final Collection<? extends Url> myUrls;
|
||||
@NotNull private final Collection<? extends BranchConfig> myTrackedInfos;
|
||||
|
||||
|
||||
private GitConfig(@NotNull Collection<Remote> remotes, @NotNull Collection<Url> urls, @NotNull Collection<BranchConfig> trackedInfos) {
|
||||
private GitConfig(@NotNull Collection<? extends Remote> remotes, @NotNull Collection<? extends Url> urls, @NotNull Collection<? extends BranchConfig> trackedInfos) {
|
||||
myRemotes = remotes;
|
||||
myUrls = urls;
|
||||
myTrackedInfos = trackedInfos;
|
||||
@@ -76,7 +76,7 @@ public class GitConfig {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static GitRemote convertRemoteToGitRemote(@NotNull Collection<Url> urls, @NotNull Remote remote) {
|
||||
private static GitRemote convertRemoteToGitRemote(@NotNull Collection<? extends Url> urls, @NotNull Remote remote) {
|
||||
UrlsAndPushUrls substitutedUrls = substituteUrls(urls, remote);
|
||||
return new GitRemote(remote.myName, substitutedUrls.getUrls(), substitutedUrls.getPushUrls(),
|
||||
remote.getFetchSpecs(), remote.getPushSpec());
|
||||
@@ -86,8 +86,8 @@ public class GitConfig {
|
||||
* Create branch tracking information based on the information defined in {@code .git/config}.
|
||||
*/
|
||||
@NotNull
|
||||
Collection<GitBranchTrackInfo> parseTrackInfos(@NotNull final Collection<GitLocalBranch> localBranches,
|
||||
@NotNull final Collection<GitRemoteBranch> remoteBranches) {
|
||||
Collection<GitBranchTrackInfo> parseTrackInfos(@NotNull final Collection<? extends GitLocalBranch> localBranches,
|
||||
@NotNull final Collection<? extends GitRemoteBranch> remoteBranches) {
|
||||
return ContainerUtil.mapNotNull(myTrackedInfos, config -> convertBranchConfig(config, localBranches, remoteBranches));
|
||||
}
|
||||
|
||||
@@ -137,8 +137,8 @@ public class GitConfig {
|
||||
|
||||
@Nullable
|
||||
private static GitBranchTrackInfo convertBranchConfig(@Nullable BranchConfig branchConfig,
|
||||
@NotNull Collection<GitLocalBranch> localBranches,
|
||||
@NotNull Collection<GitRemoteBranch> remoteBranches) {
|
||||
@NotNull Collection<? extends GitLocalBranch> localBranches,
|
||||
@NotNull Collection<? extends GitRemoteBranch> remoteBranches) {
|
||||
if (branchConfig == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -170,7 +170,7 @@ public class GitConfig {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static GitLocalBranch findLocalBranch(@NotNull String branchName, @NotNull Collection<GitLocalBranch> localBranches) {
|
||||
private static GitLocalBranch findLocalBranch(@NotNull String branchName, @NotNull Collection<? extends GitLocalBranch> localBranches) {
|
||||
final String name = GitBranchUtil.stripRefsPrefix(branchName);
|
||||
return ContainerUtil.find(localBranches, input -> input.getName().equals(name));
|
||||
}
|
||||
@@ -250,7 +250,7 @@ public class GitConfig {
|
||||
* </p>
|
||||
*/
|
||||
@NotNull
|
||||
private static UrlsAndPushUrls substituteUrls(@NotNull Collection<Url> urlSections, @NotNull Remote remote) {
|
||||
private static UrlsAndPushUrls substituteUrls(@NotNull Collection<? extends Url> urlSections, @NotNull Remote remote) {
|
||||
List<String> urls = new ArrayList<>(remote.getUrls().size());
|
||||
Collection<String> pushUrls = new ArrayList<>();
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ public class GitConflictsHolder implements Disposable {
|
||||
}
|
||||
}
|
||||
|
||||
public void refresh(@NotNull VcsDirtyScope scope, @NotNull Collection<GitConflict> conflicts) {
|
||||
public void refresh(@NotNull VcsDirtyScope scope, @NotNull Collection<? extends GitConflict> conflicts) {
|
||||
synchronized (LOCK) {
|
||||
Map<FilePath, GitConflict> map = new HashMap<>();
|
||||
for (GitConflict conflict : myConflicts) {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user