MatrixBerryCore
svncall.m
Go to the documentation of this file.
1 function [svnMsg, varargout]=svncall(ParamStr)
2 
3 % History: 2005-11-30 created
4 % 2005-12-12 callStr changed to make SVN return values
5 % independent from localization
6 
7 SMsg=struct([]);
8 % call subversion with the given parameter string
9 %callStr=sprintf('svn %s',ParamStr);
10 svnDirStr=pwd();
11 callStr=sprintf('set LC_MESSAGES=en_En&&svn %s',ParamStr);
12 [svnErr,svnMsg]=system(callStr);
13 
14 % create cellstring with one row per line
15 svnMsg=textscan(svnMsg,'%s','delimiter','\n','whitespace','');
16 svnMsg=svnMsg{1};
17 % check for an error reported by the operating system
18 if svnErr~=0
19  % an error is reported
20  if isempty(svnMsg)
21  SMsg(1).identifier='SVN:versioningProblem';
22  SMsg(1).message=['Problem using version control system:' 10 ...
23  ' Subversion could not be executed! Error code is ' ...
24  num2str(svnErr) 10 ' Path is ' svnDirStr];
25  elseif strncmp('''svn',svnMsg{1},4)
26  SMsg(1).identifier='SVN:installationProblem';
27  SMsg(1).message=['Problem using version control system:' 10 ...
28  ' Subversion could not be executed!' 10 ...
29  ' Path is ' svnDirStr];
30  else
31  SMsg(1).identifier='SVN:versioningProblem';
32  SMsg(1).message=['Problem using version control system:' 10 ...
33  mxberry.core.cell.cellstr2colstr(svnMsg,' ') 10 ...
34  ' Path is ' svnDirStr];
35  end
36 elseif ~isempty(svnMsg)
37  if strncmp('svn:',svnMsg{1},4)
38  SMsg(1).identifier='SVN:versioningProblem';
39  SMsg(1).message=['Problem using version control system:' 10 ...
40  mxberry.core.cell.cellstr2colstr(svnMsg,' ') 10 ...
41  ' Path is ' svnDirStr];
42  end
43 end
44 
45 if nargout>1
46  varargout{1}=SMsg;
47 else
48  error(SMsg);
49 end
function svncall(in ParamStr)