Example #1
0
  public void makeDir(String path) throws SVNException {
    SVNPathUtil.checkPathIsValid(path);
    FSTransactionRoot txnRoot = getTxnRoot();
    String txnId = txnRoot.getTxnID();
    FSParentPath parentPath = txnRoot.openPath(path, false, true);

    if (parentPath.getRevNode() != null) {
      SVNErrorManager.error(FSErrors.errorAlreadyExists(txnRoot, path, myFSFS), SVNLogType.FSFS);
    }

    if ((txnRoot.getTxnFlags() & FSTransactionRoot.SVN_FS_TXN_CHECK_LOCKS) != 0) {
      FSCommitter.allowLockedOperation(myFSFS, path, myAuthor, myLockTokens, true, false);
    }

    makePathMutable(parentPath.getParent(), path);
    FSRevisionNode subDirNode =
        makeEntry(
            parentPath.getParent().getRevNode(),
            parentPath.getParent().getAbsPath(),
            parentPath.getEntryName(),
            true,
            txnId);

    txnRoot.putRevNodeToCache(parentPath.getAbsPath(), subDirNode);
    addChange(
        path,
        subDirNode.getId(),
        FSPathChangeKind.FS_PATH_CHANGE_ADD,
        false,
        false,
        SVNRepository.INVALID_REVISION,
        null,
        SVNNodeKind.DIR);
  }