public static Set<WorkingCopyFormat> getUpgradeFormats( @NotNull WCInfo info, @NotNull List<WorkingCopyFormat> supportedFormats) { Set<WorkingCopyFormat> canUpgradeTo = EnumSet.noneOf(WorkingCopyFormat.class); for (WorkingCopyFormat format : supportedFormats) { if (format.isOrGreater(info.getFormat())) { canUpgradeTo.add(format); } } canUpgradeTo.add(info.getFormat()); return canUpgradeTo; }
private Collection<FilePath> chooseBinaryFiles(List<Change> converted, Set<FilePath> paths) { String singleMessage = ""; if (paths.size() == 1) { final Change change = converted.get(0); final FileStatus status = change.getFileStatus(); final FilePath path = ChangesUtil.getFilePath(change); final String stringPath = TreeConflictRefreshablePanel.filePath(path); if (FileStatus.DELETED.equals(status)) { singleMessage = "Delete binary file " + stringPath + " (according to theirs changes)?"; } else if (FileStatus.ADDED.equals(status)) { singleMessage = "Create binary file " + stringPath + " (according to theirs changes)?"; } else { singleMessage = "Apply changes to binary file " + stringPath + " (according to theirs changes)?"; } } return AbstractVcsHelper.getInstance(myVcs.getProject()) .selectFilePathsToProcess( new ArrayList<FilePath>(paths), TreeConflictRefreshablePanel.TITLE, "Select binary files to patch", TreeConflictRefreshablePanel.TITLE, singleMessage, new VcsShowConfirmationOption() { @Override public Value getValue() { return null; } @Override public void setValue(Value value) {} @Override public boolean isPersistent() { return false; } }); }