答案可能有點晚,但這裏有一些使用標記命令的示例代碼。 這個用法很簡單。
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