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.ISVNLogEntryHandler;
19: import org.tmatesoft.svn.core.SVNException;
20: import org.tmatesoft.svn.core.SVNLogEntry;
21: import org.tmatesoft.svn.core.SVNURL;
22: import org.tmatesoft.svn.core.wc.SVNClientManager;
23: import org.tmatesoft.svn.core.wc.admin.SVNAdminClient;
24:
25: /**
26: * @version 1.1.1
27: * @author TMate Software Ltd.
28: * @since 1.1.0
29: */
30: public class SVNSyncSynchronizeCommand 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: SVNClientManager manager = getClientManager();
46: SVNAdminClient adminClient = manager.getAdminClient();
47: final PrintStream outStream = out;
48: adminClient.setReplayHandler(new ISVNLogEntryHandler() {
49: public void handleLogEntry(SVNLogEntry logEntry)
50: throws SVNException {
51: SVNCommand.println(outStream, "Committed revision "
52: + logEntry.getRevision() + ".");
53: }
54: });
55: adminClient.doSynchronize(SVNURL.parseURIDecoded(destURL));
56: }
57: }
58:
59: }
|