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.admin.SVNAdminClient;
22:
23: /**
24: * @version 1.1.1
25: * @author TMate Software Ltd.
26: * @since 1.1.0
27: */
28: public class SVNSyncInitCommand extends SVNCommand {
29:
30: public void run(InputStream in, PrintStream out, PrintStream err)
31: throws SVNException {
32: run(out, err);
33: }
34:
35: public void run(PrintStream out, PrintStream err)
36: throws SVNException {
37: if (getCommandLine().hasURLs()) {
38: String destURL = getCommandLine().getURL(0);
39: if (matchTabsInURL(destURL, err)) {
40: return;
41: }
42:
43: String sourceURL = getCommandLine().getURL(1);
44: if (matchTabsInURL(sourceURL, err)) {
45: return;
46: }
47:
48: SVNClientManager manager = getClientManager();
49: SVNAdminClient adminClient = manager.getAdminClient();
50: adminClient.doInitialize(SVNURL.parseURIDecoded(sourceURL),
51: SVNURL.parseURIDecoded(destURL));
52: SVNCommand
53: .println(out, "Copied properties for revision 0.");
54: }
55: }
56: }
|