Package org.tmatesoft.svn.core.wc

Examples of org.tmatesoft.svn.core.wc.SVNRevision


        }

        boolean isRevProp = getCommandLine().hasArgument(SVNArgument.REV_PROP);
        boolean isVerbose = getCommandLine().hasArgument(SVNArgument.VERBOSE);
        File reposRoot = new File(getCommandLine().getPathAt(0))
        SVNRevision revision = SVNRevision.HEAD;
        SVNLookClient lookClient = getClientManager().getLookClient();
       
        if (getCommandLine().hasArgument(SVNArgument.TRANSACTION)) {
            String transactionName = (String) getCommandLine().getArgumentValue(SVNArgument.TRANSACTION);
            Map props = null;
View Full Code Here


        }

       
        if (getCommandLine().hasArgument(SVNArgument.REVISION) || getCommandLine().hasArgument(SVNArgument.CHANGE)) {
            // merge -rN:M urlOrPath@r wcPath
            SVNRevision rN = SVNRevision.UNDEFINED;
            SVNRevision rM = SVNRevision.UNDEFINED;
            String revStr = (String) getCommandLine().getArgumentValue(SVNArgument.REVISION);
            if (revStr == null && getCommandLine().hasArgument(SVNArgument.CHANGE)) {
                long changeRev = Long.parseLong((String) getCommandLine().getArgumentValue(SVNArgument.CHANGE));
                if (changeRev >= 0) {
                    rM = SVNRevision.create(changeRev);
                    rN = SVNRevision.create(changeRev - 1);
                } else {
                    rN = SVNRevision.create(-changeRev);
                    rM = SVNRevision.create((-changeRev) - 1);
                }
            } else if (revStr.indexOf(':') <= 0 || (revStr.indexOf('{') != -1 &&
                    revStr.indexOf("}:") == -1 && revStr.indexOf(":{") == -1)) {
                println(err, "svn: merge needs both source and target revisions to be specified");
                return;
            } else {
                SVNRevision[] revRange = getStartEndRevisions();
                rN = revRange[0];
                rM = revRange[1];
            }
            if (!rN.isValid() || !rM.isValid() || rN == SVNRevision.WORKING || rM == SVNRevision.WORKING) {
                println(err, "svn: merge needs both source and target revisions to be specified");
                return;
            }
            if (getCommandLine().hasURLs()) {
                String url = getCommandLine().getURL(0);
                SVNRevision pegRev = getCommandLine().getPegRevision(0);
                File dstPath = null; // try to get path from urls.
                if (getCommandLine().getPathCount() > 0) {
                    dstPath = new File(getCommandLine().getPathAt(0));
                }
                if (dstPath == null) {
                    dstPath = new File(SVNEncodingUtil.uriDecode(SVNPathUtil.tail(url)));
                    if (!dstPath.isFile()) {
                        dstPath = new File(".");
                    }
                }
                if (pegRev == SVNRevision.UNDEFINED) {
                    pegRev = SVNRevision.HEAD;
                }
                SVNURL svnURL = SVNURL.parseURIEncoded(url);
                differ.doMerge(svnURL, pegRev, rN, rM, dstPath, recursive, useAncestry, force, dryRun);
            } else if (getCommandLine().hasPaths()){
                File srcPath = new File(getCommandLine().getPathAt(0));
                SVNRevision pegRevision = getCommandLine().getPathPegRevision(0);
                if (pegRevision == SVNRevision.UNDEFINED) {
                    pegRevision = SVNRevision.HEAD;
                }               
                File dstPath = srcPath;
                if (getCommandLine().getPathCount() > 1) {
                    dstPath = new File(getCommandLine().getPathAt(1));
                }
                differ.doMerge(srcPath, pegRevision, rN, rM, dstPath, recursive, useAncestry, force, dryRun);
            }
        } else if (getCommandLine().getURLCount() == 2) {
            // merge url1@r url2@r wcPath
            String url1 = getCommandLine().getURL(0);
            SVNRevision rN = getCommandLine().getPegRevision(0);
            if (!rN.isValid()) {
                rN = SVNRevision.HEAD;
            }
            String url2 = getCommandLine().getURL(1);
            SVNRevision rM = getCommandLine().getPegRevision(1);
            if (!rM.isValid()) {
                rM = SVNRevision.HEAD;
            }
            File dstPath = null;
            if (getCommandLine().getPathCount() > 0) {
                dstPath = new File(getCommandLine().getPathAt(0));
            }
            if (dstPath == null) {
                String c1 = SVNPathUtil.tail(url1);
                String c2 = SVNPathUtil.tail(url2);
                if (c1.equals(c2)) {
                    dstPath = new File(SVNEncodingUtil.uriDecode(c1));
                    if (!dstPath.isFile()) {
                        dstPath = new File(".");
                    }
                }
            }
            SVNURL svnURL1 = SVNURL.parseURIEncoded(url1);
            SVNURL svnURL2 = SVNURL.parseURIEncoded(url2);

            differ.doMerge(svnURL1, rN, svnURL2, rM, dstPath, recursive, useAncestry, force, dryRun);
        } else if (getCommandLine().getPathCount() >= 2){
            // merge wcPath1@r wcPath2@r wcPath
            File path1 = new File(getCommandLine().getPathAt(0));
            SVNRevision rN = getCommandLine().getPathPegRevision(0);
            if (!rN.isValid()) {
                rN = SVNRevision.HEAD;
            }
            File path2 = new File(getCommandLine().getPathAt(1));
            SVNRevision rM = getCommandLine().getPathPegRevision(1);
            if (!rM.isValid()) {
                rM = SVNRevision.HEAD;
            }
            File dstPath = new File(".");
            if (getCommandLine().getPathCount() > 2) {
                dstPath = new File(getCommandLine().getPathAt(2));
View Full Code Here

        return new long[0];
    }

    public void copy(String srcPath, String destPath, String message, Revision revision) throws ClientException {
        SVNCopyClient client = getSVNCopyClient();
        SVNRevision srcRevision = JavaHLObjectFactory.getSVNRevision(revision);
        try {
            if(isURL(srcPath) && isURL(destPath)){
                client.doCopy(SVNURL.parseURIEncoded(srcPath), srcRevision, SVNURL.parseURIEncoded(destPath), false, message);
            } else if (isURL(srcPath) && !isURL(destPath)) {
                client.doCopy(SVNURL.parseURIEncoded(srcPath), srcRevision, new File(destPath).getAbsoluteFile());
View Full Code Here

        }
    }

    public void move(String srcPath, String destPath, String message, Revision revision, boolean force) throws ClientException {
        SVNCopyClient client = getSVNCopyClient();
        SVNRevision srcRevision = JavaHLObjectFactory.getSVNRevision(revision);
        try {
            if(isURL(srcPath) && isURL(destPath)){
                client.doCopy(SVNURL.parseURIEncoded(srcPath), srcRevision, SVNURL.parseURIEncoded(destPath), true, message);
            } else if (!isURL(srcPath) && !isURL(destPath)) {
                client.doCopy(new File(srcPath).getAbsoluteFile(), srcRevision, new File(destPath).getAbsoluteFile(), force, true);
View Full Code Here

    public void diff(String target1, Revision revision1, String target2, Revision revision2, String outFileName, boolean recurse, boolean ignoreAncestry, boolean noDiffDeleted, boolean force) throws ClientException {
        SVNDiffClient differ = getSVNDiffClient();
        differ.getDiffGenerator().setDiffDeleted(!noDiffDeleted);
        differ.getDiffGenerator().setForcedBinaryDiff(force);
        SVNRevision rev1 = JavaHLObjectFactory.getSVNRevision(revision1);
        SVNRevision rev2 = JavaHLObjectFactory.getSVNRevision(revision2);
        try {
            OutputStream out = SVNFileUtil.openFileForWriting(new File(outFileName));
            if (!isURL(target1)&&!isURL(target2)){
                differ.doDiff(new File(target1).getAbsoluteFile(), rev1,
                        new File(target2).getAbsoluteFile(), rev2,
View Full Code Here

    public void diff(String target, Revision pegRevision, Revision startRevision, Revision endRevision, String outFileName, boolean recurse, boolean ignoreAncestry, boolean noDiffDeleted, boolean force) throws ClientException {
        SVNDiffClient differ = getSVNDiffClient();
        differ.getDiffGenerator().setDiffDeleted(!noDiffDeleted);
        differ.getDiffGenerator().setForcedBinaryDiff(force);
        SVNRevision peg = JavaHLObjectFactory.getSVNRevision(pegRevision);
        SVNRevision rev1 = JavaHLObjectFactory.getSVNRevision(startRevision);
        SVNRevision rev2 = JavaHLObjectFactory.getSVNRevision(endRevision);
        try {
            OutputStream out = SVNFileUtil.openFileForWriting(new File(outFileName));
           
            if (isURL(target)){
                SVNURL url = SVNURL.parseURIEncoded(target);
View Full Code Here

    public PropertyData[] properties(String path, Revision revision, Revision pegRevision) throws ClientException {
        if(path == null){
            return null;
        }
        SVNWCClient client = getSVNWCClient();
        SVNRevision svnRevision = JavaHLObjectFactory.getSVNRevision(revision);
        SVNRevision svnPegRevision = JavaHLObjectFactory.getSVNRevision(pegRevision);
        JavaHLPropertyHandler propHandler = new JavaHLPropertyHandler(myOwner);
        try {
            if (isURL(path)){
                client.doGetProperty(SVNURL.parseURIEncoded(path), null, svnPegRevision, svnRevision, false, propHandler);
            } else {
View Full Code Here

    public PropertyData revProperty(String path, String name, Revision rev) throws ClientException {
        if(name == null || name.equals("")){
            return null;
        }
        SVNWCClient client = getSVNWCClient();
        SVNRevision svnRevision = JavaHLObjectFactory.getSVNRevision(rev);
        JavaHLPropertyHandler retriever = new JavaHLPropertyHandler(myOwner);
        try {
            if(isURL(path)){
                client.doGetRevisionProperty(SVNURL.parseURIEncoded(path), name, svnRevision, retriever);
            }else{
View Full Code Here

    public PropertyData[] revProperties(String path, Revision rev) throws ClientException {
        if(path == null){
            return null;
        }
        SVNWCClient client = getSVNWCClient();
        SVNRevision svnRevision = JavaHLObjectFactory.getSVNRevision(rev);
        JavaHLPropertyHandler propHandler = new JavaHLPropertyHandler(myOwner);
        try {
            if(isURL(path)){
                client.doGetRevisionProperty(SVNURL.parseURIEncoded(path), null, svnRevision, propHandler);
            }else{
View Full Code Here

    public void setRevProperty(String path, String name, Revision rev, String value, boolean force) throws ClientException {
        if(name == null || name.equals("")){
            return;
        }
        SVNWCClient client = getSVNWCClient();
        SVNRevision svnRevision = JavaHLObjectFactory.getSVNRevision(rev);
        try {
            if(isURL(path)){
                client.doSetRevisionProperty(SVNURL.parseURIEncoded(path),
                        svnRevision, name, value, force, ISVNPropertyHandler.NULL);
            }else{
View Full Code Here

TOP

Related Classes of org.tmatesoft.svn.core.wc.SVNRevision

Copyright © 2018 www.massapicom. 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.