Examples of FSTransactionInfo


Examples of org.tmatesoft.svn.core.internal.io.fs.FSTransactionInfo

        }
        try {
            FSFS fsfs = myResource.getFSFS();
            if (myResource.isBaseLined()) {
                if (myResource.isWorking()) {
                    FSTransactionInfo txn = myResource.getTxnInfo();
                    SVNProperties props = new SVNProperties();
                    props.put(reposPropName, (SVNPropertyValue) null);
                    fsfs.changeTransactionProperties(txn.getTxnId(), props);
                } else {
                    SVNRepository repos = myResource.getRepository();
                    repos.setRevisionPropertyValue(myResource.getRevision(), reposPropName, null);
                }
            } else {
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.io.fs.FSTransactionInfo

        FSFS fsfs = myResource.getFSFS();
        try {
            //TODO: if myProperties != null, try searching there first
            if (myResource.isBaseLined()) {
                if (myResource.getType() == DAVResourceType.WORKING) {
                    FSTransactionInfo txn = myResource.getTxnInfo();
                    props = fsfs.getTransactionProperties(txn.getTxnId());
                } else {
                    long revision = myResource.getRevision();
                    props = fsfs.getRevisionProperties(revision);
                }
            } else {
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.io.fs.FSTransactionInfo

   
        try {
            FSFS fsfs = myResource.getFSFS();
            if (myResource.isBaseLined()) {
                if (myResource.isWorking()) {
                    FSTransactionInfo txn = myResource.getTxnInfo();
                    SVNProperties props = new SVNProperties();
                    props.put(reposPropName, value);
                    fsfs.changeTransactionProperties(txn.getTxnId(), props);
                } else {
                    SVNRepository repos = myResource.getRepository();
                    repos.setRevisionPropertyValue(myResource.getRevision(), reposPropName, value);
                    //TODO: maybe add logging here
                }
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.io.fs.FSTransactionInfo

        DAVException error2 = null;
        if (error == null) {
            String path = resource.getResourceURI().getPath();
            FSRoot root = resource.getRoot();
            FSFS fsfs = resource.getFSFS();
            FSTransactionInfo txn = resource.getTxnInfo();
            Collection lockTokens = resource.getLockTokens();
            String userName = resource.getUserName();
            FSCommitter committer = getCommitter(fsfs, root, txn, lockTokens, userName);
            ISVNDeltaConsumer deltaConsumer = getDeltaConsumer(root, committer, fsfs, userName, lockTokens);
            SVNDeltaGenerator deltaGenerator = new SVNDeltaGenerator();
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.io.fs.FSTransactionInfo

        }
       
        String path = resource.getResourceURI().getPath();
        FSRoot root = resource.getRoot();
        FSFS fsfs = resource.getFSFS();
        FSTransactionInfo txn = resource.getTxnInfo();
        FSCommitter committer = getCommitter(fsfs, root, txn, resource.getLockTokens(), resource.getUserName());

        SVNNodeKind kind = DAVServletUtil.checkPath(resource.getRoot(), resource.getResourceURI().getPath());
        if (kind == SVNNodeKind.NONE) {
            try {
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.io.fs.FSTransactionInfo

                        DAVElement.SVN_DAV_ERROR_NAMESPACE, SVNErrorCode.UNSUPPORTED_FEATURE.getCode(), null);
            }
        
            String sharedActivity = DAVServlet.getSharedActivity();
            String sharedTxnName = null;
            FSTransactionInfo sharedTxnInfo = null;
            if (sharedActivity == null) {
                try {
                    sharedActivity = SVNUUIDGenerator.formatUUID(SVNUUIDGenerator.generateUUID());
                } catch (SVNException svne) {
                    throw DAVException.convertError(svne.getErrorMessage(), HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
                            "cannot generate UUID for a shared activity", null);
                }
               
                sharedTxnInfo = DAVServletUtil.createActivity(resource, fsfs);
                sharedTxnName = sharedTxnInfo.getTxnId();
                DAVServletUtil.storeActivity(resource, sharedTxnInfo.getTxnId());
                DAVServlet.setSharedActivity(sharedActivity);
            }
           
            if (sharedTxnName == null) {
                sharedTxnName = DAVServletUtil.getTxn(resource.getActivitiesDB(), sharedActivity);
                if (sharedTxnName == null) {
                    throw new DAVException("Cannot look up a txn_name by activity", null, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, null,
                            SVNLogType.NETWORK, Level.FINE, null, null, null, 0, null);
                }
            }
           
            resource = DAVWorkingResourceHelper.createWorkingResource(resource, sharedActivity, sharedTxnName, true);
            resource.setIsAutoCkeckedOut(true);
            FSTransactionInfo txnInfo = DAVServletUtil.openTxn(fsfs, resource.getTxnName());
            FSTransactionRoot txnRoot = null;
            try {
                txnRoot = fsfs.createTransactionRoot(txnInfo);
            } catch (SVNException svne) {
                throw DAVException.convertError(svne.getErrorMessage(), HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
                        "Could not open a (transaction) root in the repository", null);
            }
           
            resource.setTxnInfo(txnInfo);
            resource.setRoot(txnRoot);
            return null;
        }
       
        if (resourceType != DAVResourceType.VERSION) {
            throw new DAVException("CHECKOUT can only be performed on a version resource [at this time].", null,
                    HttpServletResponse.SC_METHOD_NOT_ALLOWED, null, SVNLogType.NETWORK, Level.FINE, null, DAVXMLUtil.SVN_DAV_ERROR_TAG,
                    DAVElement.SVN_DAV_ERROR_NAMESPACE, SVNErrorCode.UNSUPPORTED_FEATURE.getCode(), null);
        }
       
        if (isCreateActivity) {
            throw new DAVException("CHECKOUT can not create an activity at this time. Use MKACTIVITY first.", null,
                    HttpServletResponse.SC_NOT_IMPLEMENTED, null, SVNLogType.NETWORK, Level.FINE, null, DAVXMLUtil.SVN_DAV_ERROR_TAG,
                    DAVElement.SVN_DAV_ERROR_NAMESPACE, SVNErrorCode.UNSUPPORTED_FEATURE.getCode(), null);
        }
       
        if (isUnreserved) {
            throw new DAVException("Unreserved checkouts are not yet available. A version history may not be checked out more than once, into a specific activity.",
                    null, HttpServletResponse.SC_NOT_IMPLEMENTED, null, SVNLogType.NETWORK, Level.FINE, null, DAVXMLUtil.SVN_DAV_ERROR_TAG,
                    DAVElement.SVN_DAV_ERROR_NAMESPACE, SVNErrorCode.UNSUPPORTED_FEATURE.getCode(), null);
        }
       
        if (activities == null) {
            throw new DAVException("An activity must be provided for checkout.", null, HttpServletResponse.SC_CONFLICT, null, SVNLogType.NETWORK,
                    Level.FINE, null, DAVXMLUtil.SVN_DAV_ERROR_TAG, DAVElement.SVN_DAV_ERROR_NAMESPACE, SVNErrorCode.INCOMPLETE_DATA.getCode(),
                    null);
        }
       
        if (activities.size() != 1) {
            throw new DAVException("Only one activity may be specified within the CHECKOUT.", null, HttpServletResponse.SC_CONFLICT, null,
                    SVNLogType.NETWORK, Level.FINE, null, DAVXMLUtil.SVN_DAV_ERROR_TAG, DAVElement.SVN_DAV_ERROR_NAMESPACE,
                    SVNErrorCode.INCORRECT_PARAMS.getCode(), null);
        }
       
        DAVURIInfo parse = null;
       
        try {
            parse = DAVPathUtil.simpleParseURI((String) activities.get(0), resource);
        } catch (SVNException svne) {
            throw DAVException.convertError(svne.getErrorMessage(), HttpServletResponse.SC_CONFLICT, "The activity href could not be parsed properly.",
                    null);
        }
       
        if (parse.getActivityID() == null) {
            throw new DAVException("The provided href is not an activity URI.", null, HttpServletResponse.SC_CONFLICT, null, SVNLogType.NETWORK,
                    Level.FINE, null, DAVXMLUtil.SVN_DAV_ERROR_TAG, DAVElement.SVN_DAV_ERROR_NAMESPACE, SVNErrorCode.INCORRECT_PARAMS.getCode(),
                    null);
        }
       
        String txnName = DAVServletUtil.getTxn(resource.getActivitiesDB(), parse.getActivityID());
        if (txnName == null) {
            throw new DAVException("The specified activity does not exist.", null, HttpServletResponse.SC_CONFLICT, null, SVNLogType.NETWORK,
                    Level.FINE, null, DAVXMLUtil.SVN_DAV_ERROR_TAG, DAVElement.SVN_DAV_ERROR_NAMESPACE,
                    SVNErrorCode.APMOD_ACTIVITY_NOT_FOUND.getCode(), null);
        }
       
        if (resource.isBaseLined() || !SVNRevision.isValidRevisionNumber(resource.getRevision())) {
            long youngestRevision = -1;
            try {
                youngestRevision = fsfs.getYoungestRevision();
            } catch (SVNException svne) {
                throw DAVException.convertError(svne.getErrorMessage(), HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
                        "Could not determine the youngest revision for verification against the baseline being checked out.", null);
            }
           
            if (resource.getRevision() != youngestRevision) {
                throw new DAVException("The specified baseline is not the latest baseline, so it may not be checked out.", null,
                        HttpServletResponse.SC_CONFLICT, null, SVNLogType.NETWORK, Level.FINE, null, DAVXMLUtil.SVN_DAV_ERROR_TAG,
                        DAVElement.SVN_DAV_ERROR_NAMESPACE, SVNErrorCode.APMOD_BAD_BASELINE.getCode(), null);
            }
        } else {
            FSTransactionInfo txnInfo = DAVServletUtil.openTxn(fsfs, txnName);
            FSTransactionRoot txnRoot = null;
            String reposPath = resource.getResourceURI().getPath();
           
            try {
                txnRoot = fsfs.createTransactionRoot(txnInfo);
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.io.fs.FSTransactionInfo

            throw new DAVException("UNCHECKOUT called on non-working resource.", null, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, null,
                    SVNLogType.NETWORK, Level.FINE, null, DAVXMLUtil.SVN_DAV_ERROR_TAG, DAVElement.SVN_DAV_ERROR_NAMESPACE,
                    SVNErrorCode.UNSUPPORTED_FEATURE.getCode(), null);
        }
       
        FSTransactionInfo txnInfo = resource.getTxnInfo();
        if (txnInfo != null) {
            try {
                FSCommitter.abortTransaction(resource.getFSFS(), txnInfo.getTxnId());
            } catch (SVNException svne) {
                //ignore
            }
        }
       
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.io.fs.FSTransactionInfo

            sourceResource.setLockTokens(locks.values());
        }
       
        FSFS fsfs = sourceResource.getFSFS();
        String txnName = sourceResource.getTxnName();
        FSTransactionInfo txn = DAVServletUtil.openTxn(fsfs, txnName);
        FSTransactionRoot txnRoot = null;
        try {
            txnRoot = fsfs.createTransactionRoot(txn);
        } catch (SVNException svne) {
            throw DAVException.convertError(svne.getErrorMessage(), HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.io.fs.FSTransactionInfo

        }

        resource.setTxnName(txnName);
       
        FSFS fsfs = resource.getFSFS();
        FSTransactionInfo txnInfo = null;
        try {
            txnInfo = fsfs.openTxn(txnName);
        } catch (SVNException svne) {
            if (svne.getErrorMessage().getErrorCode() == SVNErrorCode.FS_NO_SUCH_TRANSACTION) {
                throw new DAVException("An activity was specified and found, but the corresponding SVN FS transaction was not found.",
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.io.fs.FSTransactionInfo

        if (txnName == null) {
            throw new DAVException("could not find activity.", HttpServletResponse.SC_NOT_FOUND, 0);
        }
       
        FSFS fsfs = resource.getFSFS();
        FSTransactionInfo txn = null;
        if (txnName != null) {
            try {
                txn = fsfs.openTxn(txnName);
            } catch (SVNException svne) {
                if (svne.getErrorMessage().getErrorCode() != SVNErrorCode.FS_NO_SUCH_TRANSACTION) {
                    throw DAVException.convertError(svne.getErrorMessage(), HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
                            "could not open transaction.", null);
                }
            }
           
            if (txn != null) {
                try {
                    FSCommitter.abortTransaction(fsfs, txn.getTxnId());
                } catch (SVNException svne) {
                    throw DAVException.convertError(svne.getErrorMessage(), HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
                            "could not abort transaction.", null);
                }
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.