本文整理汇总了Java中com.intellij.openapi.vcs.FileStatus.MERGED_WITH_CONFLICTS属性的典型用法代码示例。如果您正苦于以下问题:Java FileStatus.MERGED_WITH_CONFLICTS属性的具体用法?Java FileStatus.MERGED_WITH_CONFLICTS怎么用?Java FileStatus.MERGED_WITH_CONFLICTS使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.intellij.openapi.vcs.FileStatus
的用法示例。
在下文中一共展示了FileStatus.MERGED_WITH_CONFLICTS属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: PatchChange
public PatchChange(ContentRevision beforeRevision, ContentRevision afterRevision, AbstractFilePatchInProgress patchInProgress) {
super(beforeRevision, afterRevision,
patchInProgress.isBaseExists() || FilePatchStatus.ADDED.equals(patchInProgress.getStatus())
? null
: FileStatus.MERGED_WITH_CONFLICTS);
myPatchInProgress = patchInProgress;
}
示例2: isStatusForAddition
@Override
protected boolean isStatusForAddition(FileStatus status) {
return status == FileStatus.UNKNOWN ||
status == FileStatus.MODIFIED ||
status == FileStatus.MERGED_WITH_CONFLICTS ||
status == FileStatus.ADDED;
}
示例3: isEnabled
@Override
protected boolean isEnabled(@NotNull AnActionEvent event) {
final Collection<Change> changes = ChangeListManager.getInstance(event.getProject()).getAllChanges();
if (changes.size() > 1000) {
return true;
}
for (Change change : changes) {
if (change.getFileStatus() == FileStatus.MERGED_WITH_CONFLICTS) {
return true;
}
}
return false;
}
示例4: parseChanges
/**
* Parse changes from lines
*
* @param project the context project
* @param vcsRoot the git root
* @param thisRevision the current revision
* @param parentRevision the parent revision for this change list
* @param s the lines to parse
* @param changes a list of changes to update
* @param ignoreNames a set of names ignored during collection of the changes
* @throws VcsException if the input format does not matches expected format
*/
public static void parseChanges(Project project,
VirtualFile vcsRoot,
@Nullable GitRevisionNumber thisRevision,
@Nullable GitRevisionNumber parentRevision,
StringScanner s,
Collection<Change> changes,
final Set<String> ignoreNames) throws VcsException {
while (s.hasMoreData()) {
FileStatus status = null;
if (s.isEol()) {
s.nextLine();
continue;
}
if ("CADUMRT".indexOf(s.peek()) == -1) {
// exit if there is no next character
return;
}
String[] tokens = s.line().split("\t");
final ContentRevision before;
final ContentRevision after;
final String path = tokens[tokens.length - 1];
switch (tokens[0].charAt(0)) {
case 'C':
case 'A':
before = null;
status = FileStatus.ADDED;
after = GitContentRevision.createRevision(vcsRoot, path, thisRevision, project, false, false, true);
break;
case 'U':
status = FileStatus.MERGED_WITH_CONFLICTS;
case 'M':
if (status == null) {
status = FileStatus.MODIFIED;
}
before = GitContentRevision.createRevision(vcsRoot, path, parentRevision, project, false, true, true);
after = GitContentRevision.createRevision(vcsRoot, path, thisRevision, project, false, false, true);
break;
case 'D':
status = FileStatus.DELETED;
before = GitContentRevision.createRevision(vcsRoot, path, parentRevision, project, true, true, true);
after = null;
break;
case 'R':
status = FileStatus.MODIFIED;
before = GitContentRevision.createRevision(vcsRoot, tokens[1], parentRevision, project, true, true, true);
after = GitContentRevision.createRevision(vcsRoot, path, thisRevision, project, false, false, true);
break;
case 'T':
status = FileStatus.MODIFIED;
before = GitContentRevision.createRevision(vcsRoot, path, parentRevision, project, true, true, true);
after = GitContentRevision.createRevisionForTypeChange(project, vcsRoot, path, thisRevision, true);
break;
default:
throw new VcsException("Unknown file status: " + Arrays.asList(tokens));
}
if (ignoreNames == null || !ignoreNames.contains(path)) {
changes.add(new Change(before, after, status));
}
}
}
示例5: parseChange
private static Change parseChange(final Project project, final VirtualFile vcsRoot, final List<GitRevisionNumber> parentRevisions,
final GitLogStatusInfo statusInfo, final VcsRevisionNumber thisRevision) throws VcsException {
final ContentRevision before;
final ContentRevision after;
FileStatus status = null;
final String path = statusInfo.getFirstPath();
@Nullable GitRevisionNumber firstParent = parentRevisions.isEmpty() ? null : parentRevisions.get(0);
switch (statusInfo.getType()) {
case ADDED:
before = null;
status = FileStatus.ADDED;
after = GitContentRevision.createRevision(vcsRoot, path, thisRevision, project, false, false, true);
break;
case UNRESOLVED:
status = FileStatus.MERGED_WITH_CONFLICTS;
case MODIFIED:
if (status == null) {
status = FileStatus.MODIFIED;
}
final FilePath filePath = GitContentRevision.createPath(vcsRoot, path, false, true, true);
before = GitContentRevision.createRevision(vcsRoot, path, firstParent, project, false, false, true);
after = GitContentRevision.createRevision(filePath, thisRevision, project, null);
break;
case DELETED:
status = FileStatus.DELETED;
final FilePath filePathDeleted = GitContentRevision.createPath(vcsRoot, path, true, true, true);
before = GitContentRevision.createRevision(filePathDeleted, firstParent, project, null);
after = null;
break;
case COPIED:
case RENAMED:
status = FileStatus.MODIFIED;
String secondPath = statusInfo.getSecondPath();
final FilePath filePathAfterRename = GitContentRevision.createPath(vcsRoot, secondPath == null ? path : secondPath,
false, false, true);
before = GitContentRevision.createRevision(vcsRoot, path, firstParent, project, true, true, true);
after = GitContentRevision.createRevision(filePathAfterRename, thisRevision, project, null);
break;
case TYPE_CHANGED:
status = FileStatus.MODIFIED;
final FilePath filePath2 = GitContentRevision.createPath(vcsRoot, path, false, true, true);
before = GitContentRevision.createRevision(vcsRoot, path, firstParent, project, false, false, true);
after = GitContentRevision.createRevision(filePath2, thisRevision, project, null);
break;
default:
throw new AssertionError("Unknown file status: " + statusInfo);
}
return new Change(before, after, status);
}
示例6: getStatus
public static FileStatus getStatus(VirtualFile file, Entry entry) {
if (file == null) {
return getFileStatusForAbsentFile(entry);
}
if (entry == null) {
return getFileStatusForAbsentEntry(file);
}
if (entry.isDirectory()) {
return FileStatus.NOT_CHANGED;
}
if (entry.isAddedFile()) {
return FileStatus.ADDED;
}
if (entry.isRemoved()) {
return FileStatus.DELETED;
}
if (entry.isResultOfMerge()) {
if (entry.isConflict()) {
return FileStatus.MERGED_WITH_CONFLICTS;
}
else {
return FileStatus.MERGE;
}
}
Date revisionDate = entry.getLastModified();
if (revisionDate == null) {
return FileStatus.MODIFIED;
}
final long entryDate = revisionDate.getTime();
final long fileDate = CvsVfsUtil.getTimeStamp(file);
if (LOG.isDebugEnabled()) {
LOG.debug("getStatus() for " + file.getPath() + ": entry date " + entryDate + ", file date " + fileDate);
}
return (timeStampsAreEqual(entryDate, fileDate)) ? FileStatus.NOT_CHANGED : FileStatus.MODIFIED;
}
示例7: convertStatus
@NotNull
public static FileStatus convertStatus(@Nullable final Status status) {
if (status == null) {
return FileStatus.UNKNOWN;
}
if (status.is(StatusType.STATUS_UNVERSIONED)) {
return FileStatus.UNKNOWN;
}
else if (status.is(StatusType.STATUS_MISSING)) {
return FileStatus.DELETED_FROM_FS;
}
else if (status.is(StatusType.STATUS_EXTERNAL)) {
return SvnFileStatus.EXTERNAL;
}
else if (status.is(StatusType.STATUS_OBSTRUCTED)) {
return SvnFileStatus.OBSTRUCTED;
}
else if (status.is(StatusType.STATUS_IGNORED)) {
return FileStatus.IGNORED;
}
else if (status.is(StatusType.STATUS_ADDED)) {
return FileStatus.ADDED;
}
else if (status.is(StatusType.STATUS_DELETED)) {
return FileStatus.DELETED;
}
else if (status.is(StatusType.STATUS_REPLACED)) {
return SvnFileStatus.REPLACED;
}
else if (status.getContentsStatus() == StatusType.STATUS_CONFLICTED ||
status.getPropertiesStatus() == StatusType.STATUS_CONFLICTED) {
if (status.getContentsStatus() == StatusType.STATUS_CONFLICTED &&
status.getPropertiesStatus() == StatusType.STATUS_CONFLICTED) {
return FileStatus.MERGED_WITH_BOTH_CONFLICTS;
}
else if (status.getContentsStatus() == StatusType.STATUS_CONFLICTED) {
return FileStatus.MERGED_WITH_CONFLICTS;
}
return FileStatus.MERGED_WITH_PROPERTY_CONFLICTS;
}
else if (status.getContentsStatus() == StatusType.STATUS_MODIFIED ||
status.getPropertiesStatus() == StatusType.STATUS_MODIFIED) {
return FileStatus.MODIFIED;
}
else if (status.isSwitched()) {
return FileStatus.SWITCHED;
}
else if (status.isCopied()) {
return FileStatus.ADDED;
}
return FileStatus.NOT_CHANGED;
}