source: aedes_revision.m @ 139

Last change on this file since 139 was 139, checked in by tjniskan, 9 years ago
  • Fixed: reading procpar files failed if any VNMR parameters contained

something else than numbers alphabets or underscores. Now all
incompatible characters are replaced with underscores (e.g. com$string
-> com_string).

  • Some further iterations to the new VNMR read function aedes_readvnmr

M aedes_readprocpar.m
M aedes_readvnmr.m
M aedes_revision.m

  • Property svn:executable set to *
  • Property svn:keywords set to Revision HeadURL
File size: 2.0 KB
RevLine 
[80]1function [rev,repo,workingcopy] = aedes_revision()
2% AEDES_REVISION - Returns the current revision of Aedes
[3]3%   
4%
5% Synopsis:
[80]6%        [rev,repo,workingcopy] = aedes_revision;
[3]7%
8% Description:
9%
10% Examples:
11%
12% See also:
13%
14
[37]15% This function is a part of Aedes - A graphical tool for analyzing
[36]16% medical images
[3]17%
[36]18% Copyright (C) 2006 Juha-Pekka Niskanen <Juha-Pekka.Niskanen@uku.fi>
19%
[45]20% Department of Physics, Department of Neurobiology
[39]21% University of Kuopio, FINLAND
[36]22%
23% This program may be used under the terms of the GNU General Public
24% License version 2.0 as published by the Free Software Foundation
25% and appearing in the file LICENSE.TXT included in the packaging of
26% this program.
27%
28% This program is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
29% WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
[3]30
[36]31
[25]32rev = [];
33repo = '';
34
35% Get path to the svn working copy
36fname= mfilename('fullpath');
37[fp,fn,fe] = fileparts(fname);
38workingcopy = [fp,filesep];
39
40% Check if working copy is under version control.
[26]41if ~(exist([workingcopy,'.svn'])==7)
[25]42  rev = '$Revision: 139 $';
[27]43  rev = str2num(rev(12:end-2));
[25]44  return
45end
46
47% Check the current repository and revision
48if isunix
49  s = [];
50  w = [];
[29]51  [s,w] = unix(['svn info "',fp,'"']);
[25]52  if isempty(w)
53        return
54  end
55elseif ispc
56  s = [];
57  w = [];
[29]58  [s,w] = dos(['svn info "',fp,'"']);
[25]59  if isempty(w)
60        return
61  end
[13]62else
[25]63 
[13]64end
[3]65
[25]66% Scan the lines from the output
67C=textscan(w,'%s','delimiter','\n');
68if ~isempty(C)
69  C=C{:};
70else
71  return
72end
73
74% Get URL line
75url_ind = find(strncmpi(C,'URL:',4));
76if ~isempty(url_ind)
77  url_str = C{url_ind}(6:end);
78else
79  return
80end
81repo = url_str;
82
83% Get revision line
84rev_ind = find(strncmpi(C,'Revision:',4));
85if ~isempty(rev_ind)
86  rev_str = C{rev_ind};
87else
88  return
89end
90rev=str2num(rev_str(11:end));
91
[36]92% The next comment line is changed in every commit by the svncommit
[80]93% bash-script every time it is called so that this file "aedes_revision.m" is
[36]94% always in the list of committed files. DO NOT EDIT THE NEXT LINE!!!
[139]95% - SVN Hook -
Note: See TracBrowser for help on using the repository browser.

Powered by Trac 1.0.9.Copyright © Juha-Pekka Niskanen 2008