[英]p4java client setRoot not working
使用p4java在各種計算機上同步文件,因此我使用IClient.setRoot()相應地更改了根目錄。 但是IClient.setRoot()實際上並沒有更改客戶端對象的根目錄。我在setRoot()調用之后立即在調試器中查看
這是我連接到服務器后的代碼。
客戶端是一個IClient,而p4Server是一個IServer。
prop函數只是提取工作空間和根目錄的屬性條目
我缺少使setRoot()工作的東西。 謝謝!
client = p4Server.getClient(prop.getString("perforce.workspace"));
if (client == null) {
logger.error("Failed to fetch workspace: {}", prop.getString("perforce.workspace"));
} else {
File p4Dir = new File(prop.getPath("perforce.scripts.dest"));
if (!p4Dir.exists()) {
p4Dir.mkdirs();
}
client.setRoot(p4Dir.getPath());
logger.debug("Setting p4sync dest root to: {}",p4Dir.getPath() );
p4Server.setCurrentClient(client);
您必須在服務器上更新客戶端-setCurrentClient()不會執行此操作。
client.setRoot(p4Dir.getPath());
logger.debug("Setting p4sync dest root to: {}",p4Dir.getPath() );
client.update();
p4Server.setCurrentClient(client);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.