01: /*
02: * ====================================================================
03: * Copyright (c) 2004-2008 TMate Software Ltd. All rights reserved.
04: *
05: * This software is licensed as described in the file COPYING, which
06: * you should have received as part of this distribution. The terms
07: * are also available at http://svnkit.com/license.html
08: * If newer versions of this license are posted there, you may use a
09: * newer version instead, at your option.
10: * ====================================================================
11: */
12: package org.tmatesoft.svn.cli.command;
13:
14: import java.io.InputStream;
15: import java.io.PrintStream;
16:
17: import org.tmatesoft.svn.cli.SVNCommand;
18: import org.tmatesoft.svn.core.SVNException;
19: import org.tmatesoft.svn.core.SVNURL;
20: import org.tmatesoft.svn.core.wc.SVNClientManager;
21: import org.tmatesoft.svn.core.wc.SVNRevision;
22: import org.tmatesoft.svn.core.wc.admin.SVNAdminClient;
23: import org.tmatesoft.svn.util.SVNDebugLog;
24:
25: /**
26: * @version 1.1.1
27: * @author TMate Software Ltd.
28: * @since 1.1.0
29: */
30: public class SVNSyncCopyRevpropsCommand extends SVNCommand {
31:
32: public void run(InputStream in, PrintStream out, PrintStream err)
33: throws SVNException {
34: run(out, err);
35: }
36:
37: public void run(PrintStream out, PrintStream err)
38: throws SVNException {
39: if (getCommandLine().hasURLs()) {
40: String destURL = getCommandLine().getURL(0);
41: if (matchTabsInURL(destURL, err)) {
42: return;
43: }
44:
45: SVNRevision revision = parseRevision(getCommandLine());
46: SVNDebugLog.getDefaultLog().info(
47: getCommandLine().getPathAt(0));
48:
49: long revNumber = -1;
50: if (revision == SVNRevision.UNDEFINED) {
51:
52: } else {
53: revNumber = revision.getNumber();
54: }
55:
56: SVNClientManager manager = getClientManager();
57: SVNAdminClient adminClient = manager.getAdminClient();
58: adminClient.doCopyRevisionProperties(SVNURL
59: .parseURIDecoded(destURL), revNumber);
60: }
61: }
62:
63: }
|