• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java SVNStatusType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.tmatesoft.svn.core.wc.SVNStatusType的典型用法代码示例。如果您正苦于以下问题:Java SVNStatusType类的具体用法?Java SVNStatusType怎么用?Java SVNStatusType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SVNStatusType类属于org.tmatesoft.svn.core.wc包,在下文中一共展示了SVNStatusType类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: checkStatus

import org.tmatesoft.svn.core.wc.SVNStatusType; //导入依赖的package包/类
private static boolean checkStatus(SVNClientManager clientManager, InputFile inputFile) throws SVNException {
  SVNStatusClient statusClient = clientManager.getStatusClient();
  try {
    SVNStatus status = statusClient.doStatus(inputFile.file(), false);
    if (status == null) {
      LOG.debug("File {} returns no svn state. Skipping it.", inputFile);
      return false;
    }
    if (status.getContentsStatus() != SVNStatusType.STATUS_NORMAL) {
      LOG.debug("File {} is not versionned or contains local modifications. Skipping it.", inputFile);
      return false;
    }
  } catch (SVNException e) {
    if (SVNErrorCode.WC_PATH_NOT_FOUND.equals(e.getErrorMessage().getErrorCode())
      || SVNErrorCode.WC_NOT_WORKING_COPY.equals(e.getErrorMessage().getErrorCode())) {
      LOG.debug("File {} is not versionned. Skipping it.", inputFile);
      return false;
    }
    throw e;
  }
  return true;
}
 
开发者ID:SonarSource,项目名称:sonar-scm-svn,代码行数:23,代码来源:SvnBlameCommand.java


示例2: getStatusType

import org.tmatesoft.svn.core.wc.SVNStatusType; //导入依赖的package包/类
private SVNStatusType getStatusType(char first) {
  final SVNStatusType contentsStatus;
  if ('A' == first) {
    contentsStatus = SVNStatusType.STATUS_ADDED;
  } else if ('D' == first) {
    contentsStatus = SVNStatusType.STATUS_DELETED;
  } else if ('U' == first) {
    contentsStatus = SVNStatusType.CHANGED;
  } else if ('C' == first) {
    contentsStatus = SVNStatusType.CONFLICTED;
  } else if ('G' == first) {
    contentsStatus = SVNStatusType.MERGED;
  } else if ('R' == first) {
    contentsStatus = SVNStatusType.STATUS_REPLACED;
  } else if ('E' == first) {
    contentsStatus = SVNStatusType.STATUS_OBSTRUCTED;
  } else {
    contentsStatus = SVNStatusType.STATUS_NORMAL;
  }
  return contentsStatus;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:22,代码来源:UpdateOutputLineConverter.java


示例3: verifyExistingWorkingCopy

import org.tmatesoft.svn.core.wc.SVNStatusType; //导入依赖的package包/类
private void verifyExistingWorkingCopy() {
	final SvnGetStatus ops = svnOperationFactory.createGetStatus();
	ops.setSingleTarget(workingCopy);
	ops.setReportAll(logger.isDebugEnabled());
	final Collection<SvnStatus> statuses = tryRun(ops, new ArrayList<>(SvnStatus.class));
	
	for (final SvnStatus entry : statuses) {
		
		final SVNStatusType type = entry.getNodeStatus();
		final String filePath = entry.getPath().getPath();
		
		if (type != SVNStatusType.STATUS_NORMAL) {
			logger.error("Existing working copy is in an invalid state (maybe modified)! "
					+ "Pls fix manually or delete working copy at '" + workingCopy + "'.");
			throw new ConfigurationException(
					"Found entry with invalid status in working copy! "
					+ "Relative path: '" + filePath +"'. Status: '" + type + "'.");
		}
	}
}
 
开发者ID:Katharsas,项目名称:GMM,代码行数:21,代码来源:SvnPlugin.java


示例4: statusToString

import org.tmatesoft.svn.core.wc.SVNStatusType; //导入依赖的package包/类
private String statusToString() throws IllegalArgumentException, SVNException, IOException
{
	StringBuilder sb = new StringBuilder();

	HashMap<SVNStatusType, ArrayList<String>> result = new HashMap<>();
	getSvn().getStatusClient().doStatus(localFolder_, SVNRevision.BASE, SVNDepth.INFINITY, false, true, true, false, new ISVNStatusHandler()
	{

		@Override
		public void handleStatus(SVNStatus status) throws SVNException
		{
			ArrayList<String> temp = result.get(status.getNodeStatus());
			if (temp == null)
			{
				temp = new ArrayList<>();
				result.put(status.getNodeStatus(), temp);
			}
			String path = status.getRepositoryRelativePath();
			if (path == null || path.isEmpty())
			{
				path = getPathRelativeToRoot(status.getFile());
				if (path.isEmpty())
				{
					path = "{repo root}";
				}
			}
			temp.add(path);
		}
	}, new ArrayList<String>());

	for (Entry<SVNStatusType, ArrayList<String>> x : result.entrySet())
	{
		sb.append(x.getKey().toString() + " - " + x.getValue() + eol);
	}
	return sb.toString();
}
 
开发者ID:Apelon-VA,项目名称:ISAAC,代码行数:37,代码来源:SyncServiceSVN.java


示例5: getLocallyModifiedFiles

import org.tmatesoft.svn.core.wc.SVNStatusType; //导入依赖的package包/类
private Set<String> getLocallyModifiedFiles() throws IOException
{
	try
	{
		HashSet<String> result = new HashSet<>();
		getSvn().getStatusClient().doStatus(localFolder_, SVNRevision.BASE, SVNDepth.INFINITY, false, false, false, false, new ISVNStatusHandler()
		{

			@Override
			public void handleStatus(SVNStatus status) throws SVNException
			{
				if (status.getNodeStatus() == SVNStatusType.STATUS_MODIFIED || status.getNodeStatus() == SVNStatusType.STATUS_ADDED
						|| status.getNodeStatus() == SVNStatusType.STATUS_UNVERSIONED || status.getNodeStatus() == SVNStatusType.MERGED
						|| status.getNodeStatus() == SVNStatusType.STATUS_DELETED || status.getNodeStatus() == SVNStatusType.STATUS_REPLACED
						|| status.getNodeStatus() == SVNStatusType.MERGED)
				{
					result.add(getPathRelativeToRoot(status.getFile()));
				}
			}
		}, new ArrayList<String>());

		return result;
	}
	catch (Exception e)
	{
		log.error("Unexpected", e);
		throw new IOException("Internal error", e);
	}
}
 
开发者ID:Apelon-VA,项目名称:ISAAC,代码行数:30,代码来源:SyncServiceSVN.java


示例6: convertSingleStatus

import org.tmatesoft.svn.core.wc.SVNStatusType; //导入依赖的package包/类
private static FileStatus convertSingleStatus(final SVNStatusType status, final FileStatus defaultConflictStatus) throws SVNException {
  if (status == null) {
    return FileStatus.UNKNOWN;
  }
  if (SVNStatusType.STATUS_UNVERSIONED.equals(status)) {
    return FileStatus.UNKNOWN;
  }
  else if (SVNStatusType.STATUS_MISSING.equals(status)) {
    return FileStatus.DELETED_FROM_FS;
  }
  else if (SVNStatusType.STATUS_EXTERNAL.equals(status)) {
    return SvnFileStatus.EXTERNAL;
  }
  else if (SVNStatusType.STATUS_OBSTRUCTED.equals(status)) {
    return SvnFileStatus.OBSTRUCTED;
  }
  else if (SVNStatusType.STATUS_IGNORED.equals(status)) {
    return FileStatus.IGNORED;
  }
  else if (SVNStatusType.STATUS_ADDED.equals(status)) {
    return FileStatus.ADDED;
  }
  else if (SVNStatusType.STATUS_DELETED.equals(status)) {
    return FileStatus.DELETED;
  }
  else if (SVNStatusType.STATUS_REPLACED.equals(status)) {
    return SvnFileStatus.REPLACED;
  }
  else if (status == SVNStatusType.STATUS_CONFLICTED) {
    return defaultConflictStatus;
  }
  else if (status == SVNStatusType.STATUS_MODIFIED) {
    return FileStatus.MODIFIED;
  }
  return FileStatus.NOT_CHANGED;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:37,代码来源:SvnStatusConvertor.java


示例7: convert

import org.tmatesoft.svn.core.wc.SVNStatusType; //导入依赖的package包/类
public static SVNStatusType convert(Status.Kind kind) {
  if (kind == null) return null;
  if (Status.Kind.added.equals(kind)) {
    return SVNStatusType.STATUS_ADDED;
  } else if (Status.Kind.conflicted.equals(kind)) {
    return SVNStatusType.STATUS_CONFLICTED;
  } else if (Status.Kind.deleted.equals(kind)) {
    return SVNStatusType.STATUS_DELETED;
  } else if (Status.Kind.external.equals(kind)) {
    return SVNStatusType.STATUS_EXTERNAL;
  } else if (Status.Kind.ignored.equals(kind)) {
    // 5
    return SVNStatusType.STATUS_IGNORED;
  } else if (Status.Kind.incomplete.equals(kind)) {
    return SVNStatusType.STATUS_INCOMPLETE;
  } else if (Status.Kind.merged.equals(kind)) {
    return SVNStatusType.STATUS_MERGED;
  } else if (Status.Kind.missing.equals(kind)) {
    return SVNStatusType.STATUS_MISSING;
  } else if (Status.Kind.modified.equals(kind)) {
    return SVNStatusType.STATUS_MODIFIED;
  } else if (Status.Kind.none.equals(kind)) {
    //10
    return SVNStatusType.STATUS_NONE;
  } else if (Status.Kind.normal.equals(kind)) {
    return SVNStatusType.STATUS_NORMAL;
  } else if (Status.Kind.obstructed.equals(kind)) {
    return SVNStatusType.STATUS_OBSTRUCTED;
  } else if (Status.Kind.replaced.equals(kind)) {
    return SVNStatusType.STATUS_REPLACED;
  } else if (Status.Kind.unversioned.equals(kind)) {
    return SVNStatusType.STATUS_UNVERSIONED;
  }
  return SVNStatusType.STATUS_NONE;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:36,代码来源:StatusCallbackConvertor.java


示例8: handleInDescendants

import org.tmatesoft.svn.core.wc.SVNStatusType; //导入依赖的package包/类
protected boolean handleInDescendants(final SVNEvent event) {
  if ((event.getAction() == SVNEventAction.UPDATE_UPDATE) && (event.getContentsStatus() == SVNStatusType.UNCHANGED) &&
        (event.getPropertiesStatus() == SVNStatusType.UNKNOWN)) {
      myText2 = SvnBundle.message("progres.text2.updated", event.getFile().getName());
    return true;
  } else if (event.getAction() == SVNEventAction.DELETE) {
    addFileToGroup(FileGroup.REMOVED_FROM_REPOSITORY_ID, event);
    myText2 = SvnBundle.message("progress.text2.deleted", event.getFile().getName());
    return true;
  }
  return false;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:13,代码来源:IntegrateEventHandler.java


示例9: initMergeTarget

import org.tmatesoft.svn.core.wc.SVNStatusType; //导入依赖的package包/类
/**
 * folder that is going to keep merge info record should also be changed
 */
@Nullable
private void initMergeTarget() {
  final File mergeInfoHolder = myMerger.getMergeInfoHolder();
  if (mergeInfoHolder != null) {
    final SVNStatus svnStatus = SvnUtil.getStatus(myVcs, mergeInfoHolder);
    if ((svnStatus != null) && (SVNStatusType.STATUS_MODIFIED.equals(svnStatus.getPropertiesStatus()))) {

      myMergeTarget = FilePathImpl.create(mergeInfoHolder, mergeInfoHolder.isDirectory());
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:15,代码来源:SvnIntegrateChangesTask.java


示例10: FileData

import org.tmatesoft.svn.core.wc.SVNStatusType; //导入依赖的package包/类
public FileData(String relativePath,
                String contents,
                SVNStatusType nodeStatus,
                SVNStatusType contentsStatus,
                SVNStatusType propertiesStatus,
                boolean isDir) {
  this(relativePath, contents, nodeStatus, contentsStatus, propertiesStatus, isDir, null);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:9,代码来源:TreeConflictData.java


示例11: applyFileData

import org.tmatesoft.svn.core.wc.SVNStatusType; //导入依赖的package包/类
private void applyFileData(final VirtualFile root, final TreeConflictData.FileData fileData) throws IOException {
  final File target = new File(root.getPath(), fileData.myRelativePath);

  // we dont apply properties changes fow now
  if (SVNStatusType.STATUS_MISSING.equals(fileData.myNodeStatus)) {
    // delete existing only from fs
    FileUtil.delete(target);
    return;
  } else if (SVNStatusType.STATUS_UNVERSIONED.equals(fileData.myNodeStatus)) {
    // create new unversioned
    createFile(root, fileData, target);
    return;
  } else if (SVNStatusType.STATUS_ADDED.equals(fileData.myNodeStatus)) {
    if (fileData.myCopyFrom != null) {
      myClientRunner.copy(root, fileData.myCopyFrom, fileData.myRelativePath);
      return;
    }
    createFile(root, fileData, target);
    myClientRunner.add(root, fileData.myRelativePath);
    return;
  } else if (SVNStatusType.STATUS_DELETED.equals(fileData.myNodeStatus)) {
    myClientRunner.delete(root, fileData.myRelativePath);
    return;
  } else if (SVNStatusType.STATUS_NORMAL.equals(fileData.myNodeStatus)) {
    if (SVNStatusType.STATUS_MODIFIED.equals(fileData.myContentsStatus)) {
      createFile(root, fileData, target);
      return;
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:31,代码来源:ConflictCreator.java


示例12: addUntrackedFiles

import org.tmatesoft.svn.core.wc.SVNStatusType; //导入依赖的package包/类
/**
 * @see gov.va.isaac.interfaces.sync.ProfileSyncI#addUntrackedFiles(java.io.File)
 */
@Override
public void addUntrackedFiles() throws IllegalArgumentException, IOException
{
	log.info("Add Untracked files called");
	try
	{
		HashSet<String> result = new HashSet<>();
		HashSet<String> conflicts = new HashSet<>();
		getSvn().getStatusClient().doStatus(localFolder_, SVNRevision.BASE, SVNDepth.INFINITY, false, false, false, false, new ISVNStatusHandler()
		{

			@Override
			public void handleStatus(SVNStatus status) throws SVNException
			{
				if (status.getNodeStatus() == SVNStatusType.STATUS_UNVERSIONED)
				{
					result.add(getPathRelativeToRoot(status.getFile()));
				}
				else if (status.getNodeStatus() == SVNStatusType.STATUS_CONFLICTED)
				{
					conflicts.add(getPathRelativeToRoot(status.getFile()));
				}
			}
		}, new ArrayList<String>());

		//don't try to add conflict marker files
		for (String s : conflicts)
		{
			Iterator<String> toAdd = result.iterator();
			while (toAdd.hasNext())
			{
				String item = toAdd.next();
				if (item.equals(s + ".mine") || item.startsWith(s + ".r"))
				{
					toAdd.remove();
				}
			}
		}

		addFiles(result.toArray(new String[result.size()]));
	}
	catch (SVNException e)
	{
		log.error("Unexpected", e);
		throw new IOException("Internal error", e);
	}
}
 
开发者ID:Apelon-VA,项目名称:ISAAC,代码行数:51,代码来源:SyncServiceSVN.java


示例13: convertStatus

import org.tmatesoft.svn.core.wc.SVNStatusType; //导入依赖的package包/类
public static FileStatus convertStatus(final SVNStatus status, final boolean noticeProperties) throws SVNException {
  if (status == null) {
    return FileStatus.UNKNOWN;
  }
  if (SvnVcs.svnStatusIsUnversioned(status)) {
    return FileStatus.UNKNOWN;
  }
  else if (SvnVcs.svnStatusIs(status, SVNStatusType.STATUS_MISSING)) {
    return FileStatus.DELETED_FROM_FS;
  }
  else if (SvnVcs.svnStatusIs(status, SVNStatusType.STATUS_EXTERNAL)) {
    return SvnFileStatus.EXTERNAL;
  }
  else if (SvnVcs.svnStatusIs(status, SVNStatusType.STATUS_OBSTRUCTED)) {
    return SvnFileStatus.OBSTRUCTED;
  }
  else if (SvnVcs.svnStatusIs(status, SVNStatusType.STATUS_IGNORED)) {
    return FileStatus.IGNORED;
  }
  else if (SvnVcs.svnStatusIs(status, SVNStatusType.STATUS_ADDED)) {
    return FileStatus.ADDED;
  }
  else if (SvnVcs.svnStatusIs(status, SVNStatusType.STATUS_DELETED)) {
    return FileStatus.DELETED;
  }
  else if (SvnVcs.svnStatusIs(status, SVNStatusType.STATUS_REPLACED)) {
    return SvnFileStatus.REPLACED;
  }
  else if (status.getContentsStatus() == SVNStatusType.STATUS_CONFLICTED ||
           noticeProperties && status.getPropertiesStatus() == SVNStatusType.STATUS_CONFLICTED) {
    if (status.getContentsStatus() == SVNStatusType.STATUS_CONFLICTED &&
        noticeProperties && status.getPropertiesStatus() == SVNStatusType.STATUS_CONFLICTED) {
      return FileStatus.MERGED_WITH_BOTH_CONFLICTS;
    } else if (status.getContentsStatus() == SVNStatusType.STATUS_CONFLICTED) {
      return FileStatus.MERGED_WITH_CONFLICTS;
    }
    return FileStatus.MERGED_WITH_PROPERTY_CONFLICTS;
  }
  else if (status.getContentsStatus() == SVNStatusType.STATUS_MODIFIED ||
           noticeProperties && status.getPropertiesStatus() == SVNStatusType.STATUS_MODIFIED) {
    return FileStatus.MODIFIED;
  }
  else if (status.isSwitched()) {
    return FileStatus.SWITCHED;
  }
  else if (status.isCopied()) {
    return FileStatus.ADDED;
  }
  return FileStatus.NOT_CHANGED;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:51,代码来源:SvnStatusConvertor.java


示例14: convertPropertyStatus

import org.tmatesoft.svn.core.wc.SVNStatusType; //导入依赖的package包/类
public static FileStatus convertPropertyStatus(final SVNStatusType status) throws SVNException {
  return convertSingleStatus(status, FileStatus.MERGED_WITH_PROPERTY_CONFLICTS);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:4,代码来源:SvnStatusConvertor.java


示例15: updateStatus

import org.tmatesoft.svn.core.wc.SVNStatusType; //导入依赖的package包/类
@Override
protected void updateStatus(Attributes attributes, PortableStatus status, SVNLockWrapper lock) throws SAXException {
  final String props = attributes.getValue("props");
  assertSAX(props != null);
  final SVNStatusType propertiesStatus = StatusCallbackConvertor.convert(org.apache.subversion.javahl.types.Status.Kind.valueOf(props));
  status.setPropertiesStatus(propertiesStatus);
  final String item = attributes.getValue("item");
  assertSAX(item != null);
  final SVNStatusType contentsStatus = StatusCallbackConvertor.convert(org.apache.subversion.javahl.types.Status.Kind.valueOf(item));
  status.setContentsStatus(contentsStatus);

  if (SVNStatusType.STATUS_CONFLICTED.equals(propertiesStatus) || SVNStatusType.STATUS_CONFLICTED.equals(contentsStatus)) {
    status.setIsConflicted(true);
  }

  // optional
  final String locked = attributes.getValue("wc-locked");
  if (locked != null && Boolean.parseBoolean(locked)) {
    status.setIsLocked(true);
  }
  final String copied = attributes.getValue("copied");
  if (copied != null && Boolean.parseBoolean(copied)) {
    status.setIsCopied(true);
  }
  final String treeConflicted = attributes.getValue("tree-conflicted");
  if (treeConflicted != null && Boolean.parseBoolean(treeConflicted)) {
    status.setIsConflicted(true);
  }

  final String switched = attributes.getValue("switched");
  if (switched != null && Boolean.parseBoolean(switched)) {
    status.setIsSwitched(true);
  }

  final String revision = attributes.getValue("revision");
  if (! StringUtil.isEmptyOrSpaces(revision)) {
    try {
      final long number = Long.parseLong(revision);
      status.setRevision(SVNRevision.create(number));
    } catch (NumberFormatException e) {
      throw new SAXException(e);
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:45,代码来源:SvnStatusHandler.java


示例16: parseNormalString

import org.tmatesoft.svn.core.wc.SVNStatusType; //导入依赖的package包/类
@Nullable
private SVNEvent parseNormalString(final String line) {
  if (line.length() < 5) return null;
  final char first = line.charAt(0);
  if (' ' != first && ! ourActions.contains(first)) return null;
  final SVNStatusType contentsStatus = getStatusType(first);
  final char second = line.charAt(1);
  final SVNStatusType propertiesStatus = getStatusType(second);
  final char lock = line.charAt(2); // dont know what to do with stolen lock info
  if (' ' != lock && 'B' != lock) return null;
  final char treeConflict = line.charAt(3);
  if (' ' != treeConflict && 'C' != treeConflict) return null;
  final boolean haveTreeConflict = 'C' == treeConflict;

  final String path = line.substring(4).trim();
  if (StringUtil.isEmptyOrSpaces(path)) return null;
  final File file = new File(myBase, path);
  if (SVNStatusType.STATUS_OBSTRUCTED.equals(contentsStatus)) {
    // obstructed
    return new SVNEvent(file, file.isDirectory() ? SVNNodeKind.DIR : SVNNodeKind.FILE,
                  null, -1, contentsStatus, propertiesStatus, null, null, SVNEventAction.UPDATE_SKIP_OBSTRUCTION, SVNEventAction.UPDATE_ADD,
                  null, null, null, null, null);
  }
  
  SVNEventAction action;
  SVNEventAction expectedAction;
  if (SVNStatusType.STATUS_ADDED.equals(contentsStatus)) {
    expectedAction = SVNEventAction.UPDATE_ADD;
  } else if (SVNStatusType.STATUS_DELETED.equals(contentsStatus)) {
    expectedAction = SVNEventAction.UPDATE_DELETE;
  } else {
    expectedAction = SVNEventAction.UPDATE_UPDATE;
  }
  action = expectedAction;
  if (haveTreeConflict) {
    action = SVNEventAction.TREE_CONFLICT;
  }

  return new SVNEvent(file, file.isDirectory() ? SVNNodeKind.DIR : SVNNodeKind.FILE, null, -1, contentsStatus, propertiesStatus, null,
                      null, action, expectedAction, null, null, null, null, null);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:42,代码来源:UpdateOutputLineConverter.java


示例17: checkStatusesAfterMineFullResolve

import org.tmatesoft.svn.core.wc.SVNStatusType; //导入依赖的package包/类
private void checkStatusesAfterMineFullResolve(TreeConflictData.Data data, File conflictIoFile) {
  SVNStatus conflStatus = SvnUtil.getStatus(myVcs, conflictIoFile);
  Assert.assertTrue(createTestFailedComment(data, conflictIoFile.getPath()) + " tree conflict resolved",
                    conflStatus.getTreeConflict() == null);
  Collection<TreeConflictData.FileData> leftFiles = data.getLeftFiles();
  for (TreeConflictData.FileData file : leftFiles) {
    File exFile = new File(myWorkingCopyDir.getPath(), file.myRelativePath);
    final SVNStatus status = SvnUtil.getStatus(myVcs, exFile);
    boolean theirsExists = new File(myTheirs.getPath(), file.myRelativePath).exists();

    if (SVNStatusType.STATUS_UNVERSIONED.equals(file.myNodeStatus)) {
      Assert.assertTrue(createTestFailedComment(data, exFile.getPath()) + " (file exists)", exFile.exists());
      if (theirsExists) {
        // should be deleted
        Assert.assertTrue(createTestFailedComment(data, exFile.getPath()) + " (unversioned)", status == null || SVNStatusType.STATUS_DELETED.equals(status.getNodeStatus()));
      } else {
        // unversioned
        Assert.assertTrue(createTestFailedComment(data, exFile.getPath()) + " (unversioned)", status == null || SVNStatusType.STATUS_UNVERSIONED.equals(status.getNodeStatus()));
      }
    } else if (SVNStatusType.STATUS_DELETED.equals(file.myNodeStatus)) {
      Assert.assertTrue(createTestFailedComment(data, exFile.getPath()) + " (deleted status)", status != null && file.myNodeStatus.equals(status.getNodeStatus()));
    } else if (SVNStatusType.STATUS_ADDED.equals(file.myNodeStatus)) {
      Assert.assertTrue(createTestFailedComment(data, exFile.getPath()) + " (file exists)", exFile.exists());
      if (theirsExists) {
        Assert.assertTrue(createTestFailedComment(data, exFile.getPath()) + " (added status)", status != null && SVNStatusType.STATUS_REPLACED.equals(status.getNodeStatus()));
      } else {
        Assert.assertTrue(createTestFailedComment(data, exFile.getPath()) + " (added status)", status != null && SVNStatusType.STATUS_ADDED.equals(status.getNodeStatus()));
      }
    } else {
      if (SVNStatusType.STATUS_ADDED.equals(status.getNodeStatus())) {
        // in theirs -> deleted
        Assert.assertFalse(createTestFailedComment(data, file.myRelativePath) + " check deleted in theirs", theirsExists);
      } else {
        if (theirsExists) {
          Assert.assertTrue(createTestFailedComment(data, exFile.getPath()) + " (normal node status)", status != null && SVNStatusType.STATUS_REPLACED.equals(status.getNodeStatus()));
        } else {
          Assert.assertTrue(createTestFailedComment(data, exFile.getPath()) + " (normal node status)", status != null &&
            (SVNStatusType.STATUS_NORMAL.equals(status.getNodeStatus()) || SVNStatusType.STATUS_MODIFIED.equals(status.getNodeStatus())));
        }
      }
      Assert.assertTrue(createTestFailedComment(data, exFile.getPath()) + " (modified text status)", status != null && file.myContentsStatus.equals(status.getContentsStatus()));
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:45,代码来源:SvnResolveTreeAcceptVariantsTest.java



注:本文中的org.tmatesoft.svn.core.wc.SVNStatusType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ITreeProvider类代码示例发布时间:2022-05-22
下一篇:
Java StdTypeResolverBuilder类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap