Aufgrund eines Versionsupdates wird GitLab am 01.04. zwischen 9:00 und 9:30 Uhr kurzzeitig nicht zur Verfügung stehen. / Due to a version upgrade, GitLab won't be accessible at 01.04. between 9:00 and 9:30 a.m.

ita_revision.m 1.59 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
function varargout = ita_revision(varargin)
%ITA_REVISION - Revisionrange 
%  This function returns the Revision-Range of your working-copy. It's just
%  a simple trigger for the subversion tool svnversion for Unix based Systems 
%  or SubWCREv which comes with tortoiseSVN on Windows Systems.
%  Please NOTE: this script only works ether svnversion or SubWCREv is
%  installed.
%  
%
%  Syntax:
%   ita_revision
%
%   Reference page in Help browser 
%        <a href="matlab:doc ita_revision">doc ita_revision</a>

% <ITA-Toolbox>
% This file is part of the ITA-Toolbox. Some rights reserved. 
% You can find the license for this m-file in the license.txt file in the ITA-Toolbox folder. 
% </ITA-Toolbox>


% Author: Gregor Powarzynski -- Email: gregor.powarzynski@akustik.rwth-aachen.de
% Created:  09-Nov-2009 

% thisFuncStr  = [upper(mfilename) ':'];     %#ok<NASGU> 

if isunix 
    fcnstring = '!svnversion -c ';
elseif ispc
    fcnstring = '!SubWCRev ';
end

pathStr     = [path() pathsep];

tokenIdx    = [0 findstr(pathStr,pathsep)];
installPath= cell(0);

for idx=1:(length(tokenIdx)-1)
   tokenCell = pathStr(tokenIdx(idx)+1:tokenIdx(idx+1)-1); 

   if strcmp(tokenCell(end-10:end),'ITA-Toolbox')
      installPath=[installPath tokenCell];
   elseif strcmp(tokenCell(end-14:end),'ITA-Toolbox-dev')
      installPath=[installPath tokenCell];
   end
   
end

for i=1:length(installPath)
   [pathof,name,ext] = fileparts(installPath{i});
      
   % tries to change to the install Path and trigger the svnversion-fcn  
   disp (['The Revision-Number of ' name ' is ']);
   eval([fcnstring installPath{i}]); 
end


end