示例#1
0
  private void copy(
      FSRevisionNode toNode,
      String entryName,
      FSRevisionNode fromNode,
      boolean preserveHistory,
      long fromRevision,
      String fromPath,
      String txnId)
      throws SVNException {
    FSID id = null;
    FSTransactionRoot txnRoot = getTxnRoot();
    if (preserveHistory) {
      FSID srcId = fromNode.getId();
      FSRevisionNode toRevNode = FSRevisionNode.dumpRevisionNode(fromNode);
      String copyId = reserveCopyId(txnId);

      toRevNode.setPredecessorId(srcId);
      if (toRevNode.getCount() != -1) {
        toRevNode.setCount(toRevNode.getCount() + 1);
      }
      String createdPath =
          SVNPathUtil.getAbsolutePath(SVNPathUtil.append(toNode.getCreatedPath(), entryName));
      toRevNode.setCreatedPath(createdPath);
      toRevNode.setCopyFromPath(fromPath);
      toRevNode.setCopyFromRevision(fromRevision);

      toRevNode.setCopyRootPath(null);
      id = txnRoot.createSuccessor(srcId, toRevNode, copyId);
    } else {
      id = fromNode.getId();
    }

    txnRoot.setEntry(toNode, entryName, id, fromNode.getType());
  }