当前位置: 首页>>代码示例>>Java>>正文


Java SVNStatus类代码示例

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


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

示例1: create

import org.tmatesoft.svn.core.wc.SVNStatus; //导入依赖的package包/类
@Nullable
public static Status create(@Nullable SVNStatus status) {
  Status result = null;

  if (status != null) {
    result =
      new Status(status.getURL(), status.getFile(), NodeKind.from(status.getKind()), status.getRevision(), status.getCommittedRevision(),
                 StatusType.from(status.getContentsStatus()), StatusType.from(status.getPropertiesStatus()),
                 StatusType.from(status.getRemoteContentsStatus()), StatusType.from(status.getRemotePropertiesStatus()),
                 status.isLocked(), status.isCopied(), status.isSwitched(), status.getCopyFromURL(), Lock.create(status.getRemoteLock()),
                 Lock.create(status.getLocalLock()), status.getChangelistName(),
                 TreeConflictDescription.create(status.getTreeConflict()));
    result.setIsConflicted(status.isConflicted());
    result.setNodeStatus(StatusType.from(status.getNodeStatus()));
    result.setRemoteNodeStatus(StatusType.from(status.getRemoteNodeStatus()));
    result.setRemoteRevision(status.getRemoteRevision());
    result.setRepositoryRootURL(status.getRepositoryRootURL());
  }

  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:Status.java

示例2: checkStatus

import org.tmatesoft.svn.core.wc.SVNStatus; //导入依赖的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

示例3: getCurrentMapping

import org.tmatesoft.svn.core.wc.SVNStatus; //导入依赖的package包/类
@Nullable
public static String getCurrentMapping(final Project project, final File file) {
  final SvnVcs vcs = SvnVcs.getInstance(project);
  final SVNStatusClient statusClient = vcs.createStatusClient();
  try {
    final SVNStatus status = statusClient.doStatus(file, false);
    return status == null ? null : status.getChangelistName();
  }
  catch (SVNException e) {
    final SVNErrorCode errorCode = e.getErrorMessage().getErrorCode();
    if (SVNErrorCode.WC_NOT_DIRECTORY.equals(errorCode) || SVNErrorCode.WC_NOT_FILE.equals(errorCode)) {
      LOG.debug("Logging only, exception is valid (caught) here", e);
    } else {
      LOG.info("Logging only, exception is valid (caught) here", e);
    }
  }
  return null;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:19,代码来源:SvnChangelistListener.java

示例4: convert

import org.tmatesoft.svn.core.wc.SVNStatus; //导入依赖的package包/类
public static SVNStatus convert(final String path, Status status, final Convertor<String, SVNInfo> infoGetter) throws SVNException {
    // no locks
  return new PortableStatus(createUrl(status.getUrl()), new File(path), NodeKindConvertor.convert(status.getNodeKind()),
                            RevisionConvertor.convert(status.getRevision()), RevisionConvertor.convert(status.getLastChangedRevision()),
                            status.getLastChangedDate(), status.getLastCommitAuthor(), convert(status.getTextStatus()),
                            convert(status.getPropStatus()), convert(status.getRepositoryTextStatus()),
                            convert(status.getRepositoryPropStatus()), status.isLocked(), status.isCopied(), status.isSwitched(),
                            status.isFileExternal(), null, null, null, status.getChangelist(), WorkingCopyFormat.ONE_DOT_SEVEN.getFormat(),
                            status.isConflicted(),
                            new Getter<SVNInfo>() {
                              @Override
                              public SVNInfo get() {
                                return infoGetter.convert(path);
                              }
                            });
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:StatusCallbackConvertor.java

示例5: getRemoteUrl

import org.tmatesoft.svn.core.wc.SVNStatus; //导入依赖的package包/类
String getRemoteUrl(String localPath) {
    try {
        File svnWorkDir = Paths.get(localPath).toAbsolutePath().normalize().toFile();
        SVNStatusClient statusClient = SVNClientManager.newInstance().getStatusClient();
        final SVNStatus status = statusClient.doStatus(svnWorkDir, false);
        return status.getURL().toString();
    } catch (Exception ignored) {
        return "";
    }
}
 
开发者ID:pivio,项目名称:pivio-client,代码行数:11,代码来源:SvnReader.java

示例6: statusToString

import org.tmatesoft.svn.core.wc.SVNStatus; //导入依赖的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

示例7: getLocallyModifiedFiles

import org.tmatesoft.svn.core.wc.SVNStatus; //导入依赖的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

示例8: getFilesInMergeConflict

import org.tmatesoft.svn.core.wc.SVNStatus; //导入依赖的package包/类
/**
 * @throws IOException
 * @see gov.va.isaac.interfaces.sync.ProfileSyncI#getFilesInMergeConflict()
 */
@Override
public Set<String> getFilesInMergeConflict() 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.isConflicted())
				{
					result.add(status.getRepositoryRelativePath());
				}
			}
		}, new ArrayList<String>());

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

示例9: changeListNameFromStatus

import org.tmatesoft.svn.core.wc.SVNStatus; //导入依赖的package包/类
@Nullable
private String changeListNameFromStatus(final SVNStatus status) {
  if (WorkingCopyFormat.getInstance(status.getWorkingCopyFormat()).supportsChangelists()) {
    if (SVNNodeKind.FILE.equals(status.getKind())) {
      final String clName = status.getChangelistName();
      return (clName == null) ? null : clName;
    }
  }
  // always null for earlier versions
  return null;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:12,代码来源:SvnChangeProvider.java

示例10: initMergeTarget

import org.tmatesoft.svn.core.wc.SVNStatus; //导入依赖的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

示例11: getStatus

import org.tmatesoft.svn.core.wc.SVNStatus; //导入依赖的package包/类
public static SVNStatus getStatus(SVNClientManager clientManager, File wcPath, boolean isRemote) throws SVNException {
	return clientManager.getStatusClient().doStatus(wcPath, isRemote);
}
 
开发者ID:AgarwalNeha1,项目名称:gluu,代码行数:4,代码来源:SvnHelper.java

示例12: addUntrackedFiles

import org.tmatesoft.svn.core.wc.SVNStatus; //导入依赖的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: createBaseRevision

import org.tmatesoft.svn.core.wc.SVNStatus; //导入依赖的package包/类
public static SvnContentRevision createBaseRevision(@NotNull SvnVcs vcs, @NotNull final FilePath file, final SVNStatus status) {
  SVNRevision revision = status.getRevision().isValid() ? status.getRevision() : status.getCommittedRevision();
  return createBaseRevision(vcs, file, revision);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:5,代码来源:SvnContentRevision.java

示例14: convertStatus

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

示例15: convertContentsStatus

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


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