答案可能有点晚,但这里有一些使用标记命令的示例代码。 这个用法很简单。
1)创建客户端。
PServerConnection con = new PServerConnection(getCVSRoot());
con.setEncodedPassword(StandardScrambler.getInstance().scramble(password));
GlobalOptions globalOptions = new GlobalOptions();
globalOptions.setCVSRoot(getCVSRoot().toString());
client = new Client(connection, new StandardAdminHandler());
// this line is important, because otherwise you'll get a
// NullpointerException!
client.setLocalPath(localPath);
2)创建标签命令
TagCommand tagCmd = new TagCommand();
tagCmd.setTag(tag);
tagCmd.setOverrideExistingTag(true);
3)执行
client.getConnection().open();
boolean success = client.executeCommand(cmd, globalOptions);
client.getConnection().close();
我使用的最新版本从[1]。
问候里奇
[1] http://netbeans.org/projects/versioncontrol/downloads/
任何人都可以看看这个。 – David 2011-12-28 10:25:08