我覺得沒有答案尚未真正解決了在這個意義上的問題,如果改變svn:externals的一部分已經制作完成,當然應該顯示它們。這對於真正的外部存儲庫來說是沒有意義的。但是我使用svn:externals將同一個存儲庫中的一個通用構建文件夾添加到項目中(因爲不存在模塊的通用層次)。我不想使用選項--ignore-externals -q
,因爲我鬆散了有關未添加文件的信息以及我在此項目中完成的一般構建腳本(我可能想要提交)中的更改。我的解決方案是修補subversion java命令行實現svnkit。
AbstractSVNCommand.registerCommand(new SVNStatusCommand());
final ByteArrayOutputStream bos = new ByteArrayOutputStream();
final PrintStream stream = new PrintStream(bos);
final SVNCommandLine commandLine = new SVNCommandLine();
commandLine.init(new String[] { "status", "PATH..." });
final SVNCommandEnvironment env = new SVNCommandEnvironment("mySvn", stream, stream, System.in);
env.init(commandLine);
env.initClientManager();
final SVNStatusCommand svnStatusCall = new SVNStatusCommand();
svnStatusCall.init(env);
svnStatusCall.run();
stream.flush();
String result = new String(bos.toByteArray());
StringBuffer buffer = new StringBuffer();
Scanner scanner = new Scanner(result);
while (scanner.hasNextLine()) {
String line = scanner.nextLine();
if (line.startsWith("X") || line.startsWith("Performing status on external item at")) {
// ignore this output
} else if (line.trim().isEmpty() == false) {
buffer.append(line + "\n");
}
}
System.out.println(buffer.toString());
這解決了問題,因爲在變化的外部還標有「M」的修改...
來源
2012-10-31 07:34:17
jan
+1我有同樣的問題,我寧願喜歡 - 忽略的外部是默認或可配置爲默認。 – 2010-09-02 04:27:58
只需清楚:-q(安靜模式)刪除「X lib」行並且--ignore-externals刪除「在'lib'上執行外部項目的狀態」行。最好根據此更新答案。 – 2010-09-02 04:31:03
對於它的價值,http://subversion.tigris.org/issues/show_bug.cgi?id=1935有一個漫長的討論,我還沒有完成閱讀。到目前爲止,它似乎是一個合理的共識,如果在2004年確定了這個問題....../- :: – tripleee 2012-03-15 13:44:07