1

I need to run and SVN commit using Objective C The code to run SVN command is like this using an command line application

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);

but I am getting this error

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

I tried updating the command line tools but didnt work

On initial stages I tried SVN commit using terminal but it also showed the same error so based on this link I have updated the SVN using terminal too but it still shows the error on running the code

I also updated /bin/sh with new SVN but doest work (Also tried with /bin/bash)

Any suggestion to avoid this error and commit it to repository ??

Girish Nair
  • 5,148
  • 5
  • 40
  • 61
  • See here: http://stackoverflow.com/questions/25294420/svn-e155021-this-client-is-too-old-to-work-with-the-working-copy-at-xxx-forma – qwerty_so May 26 '15 at 11:57
  • Already went through that link, also it has no accepted answer – Girish Nair May 26 '15 at 12:21
  • You still have an old version of the svn binaries hanging around on your system. You need to find them and upgrade them. Why aren't you using the C bindings/libraries directly? Wouldn't that be better than calling an external program? – alroc May 26 '15 at 12:50
  • when I check the version of svn i get as 1.8.9 and works with terminal but when i run it through Command line app it gives me that error!!! And what do you mean by using the C bindings/libraries directly ? Can you give a reference or some code reference ?? – Girish Nair May 26 '15 at 12:58

1 Answers1

1

Finally got the solution

I used the which svn command to find where the svn was installed now, while running the command from run button in Xcode it was giving the location as /Applications/Xcode.app/Contents/Developer/usr/bin/svn

but the terminal was using the location /usr/local/bin/svn

So under Xcode goto Products folder and copy the Application Name.app file and paste it to desktop and double click to run it and now it will work fine

But if you need a work around this is what I did

Do it at your own risk

  1. Goto /Applications/Xcode.app/Contents/Developer/usr/bin/ and copy all files starting with svn title and keep it as backup.(Please remember the files that you copy)

  2. Goto /usr/local/bin/svn and copy and replace svn files from here to /Applications/Xcode.app/Contents/Developer/usr/bin/

  3. Now run it and you will not get any version error

Cheers !!! :)

Girish Nair
  • 5,148
  • 5
  • 40
  • 61