2015-05-26 160 views
1

我需要運行和SVN提交使用Objective C的 代碼運行SVN命令被這樣使用命令行應用程序更新SVN在OSX命令行項目

NSString *command = @"svn add folder; svn commit -m \"Test Add\"" 
NSArray *arguments = [NSArray arrayWithObjects:@"-c",command, nil]; 
NSTask *task = [[NSTask alloc] init]; 
[task setLaunchPath:@"/bin/sh"]; 
[task setArguments:arguments]; 

NSPipe *pipe = [NSPipe pipe]; 
[task setStandardOutput:pipe]; 
NSFileHandle *file = [pipe fileHandleForReading]; 
[task launch]; 
NSData *data = [file readDataToEndOfFile]; 
NSString *output = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; 
NSLog(@"Output %@",output); 

但我正在逐漸這個錯誤

svn: E155021: This client is too old to work with the working copy at ... 
You need to get a newer Subversion client. For more details, see 
    http://subversion.apache.org/faq.html#working-copy-format-change 

我嘗試更新的命令行工具,但沒有工作

在初始階段,我試着SVN提交使用終端,但它也表現出這樣基於此link我一直在使用終端也更新了SVN相同的錯誤,但它仍然顯示錯誤上運行的代碼

我也更新/bin/sh的新SVN,但所行的工作(也可以通過/斌/慶典試過)

任何建議,以避免該錯誤並提交到存儲庫?

+0

在這裏看到:http://stackoverflow.com/questions/25294420/svn-e155021-this-client-is-too-old-to-work-with-the-working-copy-at-xxx-備考 –

+0

已通過該鏈接去了,也有沒有公認的答案 –

+0

你仍然有一箇舊版本的二進制文件的svn遊逛您的系統上。你需要找到它們並升級它們。你爲什麼不直接使用C綁定/庫?這不比調用外部程序更好嗎? – alroc

回答

1

終於拿到

我用這svn的命令查找其中的svn安裝 現在,在Xcode中運行,從運行按鈕的命令,而它給人的位置爲/應用解決方案/Xcode.app/Contents/Developer/usr/bin/svn

但用的是位置 的/ usr/local/bin中/ SVN終端

所以在Xcode中轉到產品文件夾,複製應用Name.app文件,並將其粘貼到桌面並雙擊運行它,現在它會正常工作

但是如果你需要解決這個作品是什麼我做

您自己的風險做這

  1. 轉到/Applications/Xcode.app/Contents/Developer/usr/bin/和(請記住您複製的文件)

  2. 轉到/ usr/local/bin/svn並將svn文件從這裏複製並替換爲/ Applications/Xcode。應用/內容/開發人員的/ usr/bin中/

  3. 現在運行它,你不會得到任何版本的錯誤

乾杯! :)