Example #1
0
  protected SVNDirEntry run() throws SVNException {
    SvnTarget infoTarget = getOperation().getFirstTarget();
    Structure<RepositoryInfo> repositoryInfo =
        getRepositoryAccess()
            .createRepositoryFor(
                infoTarget,
                getOperation().getRevision(),
                infoTarget.getResolvedPegRevision(),
                null);

    SVNRepository repository = repositoryInfo.<SVNRepository>get(RepositoryInfo.repository);
    long revNum = repositoryInfo.lng(RepositoryInfo.revision);

    repositoryInfo.release();

    doList(
        repository,
        revNum,
        this,
        getOperation().isFetchLocks(),
        getOperation().getDepth(),
        getOperation().getEntryFields(),
        null,
        null);

    return getOperation().first();
  }
Example #2
0
  private void doExternalStatus(Map<File, File> externalsNew) throws SVNException {
    for (Iterator<File> paths = externalsNew.keySet().iterator(); paths.hasNext(); ) {
      File fullPath = paths.next();
      File wcRootAbsPath = externalsNew.get(fullPath);

      Structure<StructureFields.ExternalNodeInfo> externalInfo =
          SvnWcDbExternals.readExternal(
              getWcContext(), fullPath, wcRootAbsPath, StructureFields.ExternalNodeInfo.kind);
      ISVNWCDb.SVNWCDbKind externalKind = externalInfo.get(StructureFields.ExternalNodeInfo.kind);

      if (externalKind != ISVNWCDb.SVNWCDbKind.Dir) {
        continue;
      }

      if (SVNFileType.getType(fullPath) != SVNFileType.DIRECTORY) {
        continue;
      }
      handleEvent(
          SVNEventFactory.createSVNEvent(
              fullPath,
              SVNNodeKind.DIR,
              null,
              SVNRepository.INVALID_REVISION,
              SVNEventAction.STATUS_EXTERNAL,
              null,
              null,
              null),
          ISVNEventHandler.UNKNOWN);
      try {

        SvnGetStatus getStatus = getOperation().getOperationFactory().createGetStatus();
        getStatus.setSingleTarget(SvnTarget.fromFile(fullPath));
        getStatus.setRevision(SVNRevision.HEAD);
        getStatus.setDepth(getOperation().getDepth());
        getStatus.setRemote(getOperation().isRemote());
        getStatus.setReportAll(getOperation().isReportAll());
        getStatus.setReportIgnored(getOperation().isReportIgnored());
        getStatus.setReportExternals(getOperation().isReportExternals());
        getStatus.setReceiver(getOperation().getReceiver());
        getStatus.setFileListHook(getOperation().getFileListHook());

        getStatus.run();
      } catch (SVNException e) {
        if (e instanceof SVNCancelException) {
          throw e;
        }
      }
    }
  }