Exemplo n.º 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());
  }
Exemplo n.º 2
0
 private static void updateAncestry(
     FSFS owner, FSID sourceId, FSID targetId, String targetPath, long sourcePredecessorCount)
     throws SVNException {
   if (!targetId.isTxn()) {
     SVNErrorMessage err =
         SVNErrorMessage.create(
             SVNErrorCode.FS_NOT_MUTABLE, "Unexpected immutable node at ''{0}''", targetPath);
     SVNErrorManager.error(err, SVNLogType.FSFS);
   }
   FSRevisionNode revNode = owner.getRevisionNode(targetId);
   revNode.setPredecessorId(sourceId);
   revNode.setCount(
       sourcePredecessorCount != -1 ? sourcePredecessorCount + 1 : sourcePredecessorCount);
   revNode.setIsFreshTxnRoot(false);
   owner.putTxnRevisionNode(targetId, revNode);
 }