Changeset 78 for an2_update.m


Ignore:
Timestamp:
Feb 17, 2009, 3:00:56 PM (10 years ago)
Author:
tjniskan
Message:
  • Moved fMRI related plugins to their own subdirectories
  • Created a subdirectory for map calculation plugins and added a few

basic plugins for those. At the moment these plugins do not support
masking etc. and I didn't test them at all so be cautious...

  • Made a minor memory optimation to an2_readfid.m
  • Fixed a few issues in files related updating via SVN
  • Disabled some annoying warnings that Matlab R2008a and higher

generate from uitree and uitreenode functions inan2_juigetfiles.m

  • Coded something minor to an2_maptool.m. This is still stub and does

not work at all. Please don't try to use it.

  • Fixed a bug that caused Aedes to fail without generating an error

when reading VNMR FID-files that don't have PROCPAR in the same folder.

  • Fixed a javaFrame -warning (with R2008a and higher) in aedes.m

M an2_revision.m
M an2_data_read.m
M an2_maptool.m
M aedes.m
D plugins/calculate_t2_map.m
D plugins/calculate_t1r_map.m
D plugins/basic_fmri_analysis.m
D plugins/resting_state_fc.m
A plugins/fmri_plugins
A plugins/fmri_plugins/basic_fmri_analysis.m
A plugins/fmri_plugins/resting_state_fc.m
A plugins/map_plugins
A plugins/map_plugins/t2.m
A plugins/map_plugins/t1_3_parameter_fit.m
A plugins/map_plugins/t1_saturation_recovery.m
A plugins/map_plugins/t1_rho.m
A plugins/map_plugins/t2_rho.m
A plugins/map_plugins/t1_inversion_recovery.m
M an2_readfid.m
M an2_check_updates.m
M an2_juigetfiles.m
M an2_update.m

File:
1 edited

Legend:

Unmodified
Added
Removed
  • an2_update.m

    r45 r78  
    3939
    4040% Check if updates are available
    41 [isUpdateAvailable,HeadRev,WorkingCopyRev]=an2_check_updates();
     41[isUpdateAvailable,HeadRev,WorkingCopyRev,error_msg]=an2_check_updates();
    4242
    4343if isUpdateAvailable
    4444  if strcmpi(opt,'noprompt')
    45         fprintf(1,'Updating from revision %d to %d\n',...
    46           WorkingCopyRev,HeadRev)
     45    fprintf(1,'Updating from revision %d to %d\n',...
     46      WorkingCopyRev,HeadRev)
    4747  elseif any(strcmpi(opt,{'prompt','semiprompt'}))
    48         % Prompt for updates
    49         dialog_str = {'Updates for Aedes are available.',...
    50           '',...
    51           ['Your current revision: ',num2str(WorkingCopyRev)],...
    52           ['The latest revision: ',num2str(HeadRev)],...
    53           '',...
    54           'Do you want install updates now?',...
    55           '',...
    56           '',...
    57           ['NOTE: You can disable automatic update checking from the',...
    58           ' Tools-menu in Aedes.']};
    59         resp=questdlg(dialog_str,'Updates available. Install now?',...
    60           'Yes','No','Yes');
    61         if strcmpi(resp,'No')
    62           done = [];
    63           return
    64         end
    65         [cwh,txh]=an2_calc_wait('Installing updates...');
     48    % Prompt for updates
     49    dialog_str = {'Updates for Aedes are available.',...
     50      '',...
     51      ['Your current revision: ',num2str(WorkingCopyRev)],...
     52      ['The latest revision: ',num2str(HeadRev)],...
     53      '',...
     54      'Do you want to install updates now?'};
     55    resp=questdlg(dialog_str,'Updates available. Install updates now?',...
     56      'Yes','No','Yes');
     57    if strcmpi(resp,'No')
     58      done = [];
     59      return
     60    end
     61    [cwh,txh]=an2_calc_wait('Installing updates...');
    6662  end
    6763elseif isempty(HeadRev)
    6864  % Something wrong with SVN
    6965  if strcmpi(opt,'prompt')
    70         h=warndlg('Could not check updates. Is SVN properly installed?',...
    71           'Could not check updates','modal');
    72         uiwait(h);
    73         return
     66    h=warndlg({'Could not check updates. Do you have hetwork access and is SVN properly installed?','',...
     67      'The following error was encountered:','',...
     68      error_msg},...
     69      'Could not check updates','modal');
     70    uiwait(h);
     71    return
    7472  elseif any(strcmpi(opt,{'noprompt','semiprompt'}))
    75         fprintf(1,'Could not check updates. Is SVN properly installed?\n')
    76         return
    77   end
    78 
    79 elseif HeadRev<0
    80   % Something wrong with network. Not inside University network
    81   if strcmpi(opt,'prompt')
    82         h=warndlg('Could not check updates. Are you connected to Kuopio University network?',...
    83           'Could not check updates','modal');
    84         uiwait(h);
    85         return
    86   elseif any(strcmpi(opt,{'noprompt','semiprompt'}))
    87         fprintf(1,'Could not check updates. Are you connected to Kuopio University network?\n')
    88         return
     73    fprintf(1,'Could not check updates.\n');
     74    fprintf(1,'The following error was encountered:\n');
     75    fprintf(1,error_msg);
     76    return
    8977  end
    9078else
     
    9280  % semiprompt mode is selected
    9381  if strcmpi(opt,'prompt')
    94         h=helpdlg('No updates available. Aedes is up-to-date.',...
    95           'Aedes up-to-date');
    96         uiwait(h);
     82    h=helpdlg('No updates available. Aedes is up-to-date.',...
     83      'Aedes up-to-date');
     84    uiwait(h);
    9785  elseif strcmpi(opt,'noprompt')
    98         fprintf(1,'No updates available. Aedes is up-to-date.\n');
     86    fprintf(1,'No updates available. Aedes is up-to-date.\n');
    9987  end
    10088  return
     
    113101  C=C{:};
    114102else
    115  
     103  % Mac OSX
     104  [s,w]=unix(['svn up "',fp,'"']);
     105  C=textscan(w,'%s','delimiter','\n');
     106  C=C{:};
    116107end
    117108if s~=0
    118109  try
    119         delete(cwh)
     110    delete(cwh)
    120111  catch
    121112  end
    122113  if any(strcmpi(opt,{'prompt','semiprompt'}))
    123         h=errordlg({'Update failed because of following error:',...
    124           C{:}},...
    125           'Update failed','modal');
    126         uiwait(h);
    127         return
     114    h=errordlg({'Update failed because of following error:',...
     115      C{:}},...
     116      'Update failed','modal');
     117    uiwait(h);
     118    return
    128119  elseif strcmpi(opt,'noprompt')
    129         fprintf(1,'\n********************* ERROR ***********************\n')
    130         fprintf(1,'Update failed because of following error:\n');
    131         fprintf(1,'%s\n',C{:});
    132         fprintf(1,'***************************************************\n')
    133         return
     120    fprintf(1,'\n********************* ERROR ***********************\n')
     121    fprintf(1,'Update failed because of following error:\n');
     122    fprintf(1,'%s\n',C{:});
     123    fprintf(1,'***************************************************\n')
     124    return
    134125  end
    135126end
     
    148139for ii=1:length(C)
    149140  if strncmpi(C{ii},'C  ',3)
    150         % Conflict
    151         c_ind(end+1)=ii;
     141    % Conflict
     142    c_ind(end+1)=ii;
    152143  elseif strncmpi(C{ii},'G  ',3)
    153         % Merge
    154         g_ind(end+1)=ii;
     144    % Merge
     145    g_ind(end+1)=ii;
    155146  end
    156147end
     
    165156  % Update successful
    166157  if any(strcmpi(opt,{'prompt','semiprompt'}))
    167         resp=questdlg({['Updated successfully to revision ',num2str(HeadRev),'.'],...
    168           '',...
    169           ['You can use "View Details..." the view the changelog.']},...
    170           'Update successful','OK','View Details...','View Details...');
    171         if strcmpi(resp,'View Details...')
    172           ShowChangeLog = true;
    173         else
    174           ShowChangeLog = false;
    175         end
     158    resp=questdlg({['Updated successfully to revision ',num2str(HeadRev),'.'],...
     159      '',...
     160      ['You can use "View Details..." the view the changelog.']},...
     161      'Update successful','OK','View Details...','View Details...');
     162    if strcmpi(resp,'View Details...')
     163      ShowChangeLog = true;
     164    else
     165      ShowChangeLog = false;
     166    end
    176167  elseif strcmpi(opt,'noprompt')
    177         fprintf(1,'Updated successfully to revision %d\n',HeadRev);
    178        
    179         % Echo the update information to the command window
    180         fprintf(1,'%s\n',C{:});
    181         fprintf(1,'Update complete.\n');
     168    fprintf(1,'Updated successfully to revision %d\n',HeadRev);
     169   
     170    % Echo the update information to the command window
     171    fprintf(1,'%s\n',C{:});
     172    fprintf(1,'Update complete.\n');
    182173  end
    183174 
     
    189180  % Show the Change log and information
    190181  if ShowChangeLog
    191         if isunix
    192           [s,w] = unix(sprintf('svn log "%s" -r%d:%d',...
    193                 fp,HeadRev,WorkingCopyRev+1));
    194           if s~=0
    195                
    196           end
    197         elseif ispc
    198           [s,w] = dos(sprintf('svn log "%s" -r%d:%d',...
    199                 fp,HeadRev,WorkingCopyRev+1));
    200           if s~=0
    201                
    202           end
    203         else
    204          
    205         end
    206         W = textscan(w,'%s','delimiter','\n');
    207         W=W{:};
    208         web(['text://',...
    209           '<title>Update information and changelog</title>',...
    210           sprintf('<h1>Updated Aedes successfully to revision %d</h1>',...
    211           HeadRev),...
    212           sprintf('<h2>Updated files from revision %d to %d</h2>',...
    213           WorkingCopyRev,HeadRev),...
    214           sprintf('%s<br>',C{:}),...
    215           '<br>',...
    216           sprintf('<h2>Changelog from revision %d to %d</h2>',...
    217           WorkingCopyRev,HeadRev),...
    218           sprintf('%s<br>',W{:})]);
     182    if isunix
     183      [s,w] = unix(sprintf('svn log "%s" -r%d:%d',...
     184        fp,HeadRev,WorkingCopyRev+1));
     185      if s~=0
     186       
     187      end
     188    elseif ispc
     189      [s,w] = dos(sprintf('svn log "%s" -r%d:%d',...
     190        fp,HeadRev,WorkingCopyRev+1));
     191      if s~=0
     192       
     193      end
     194    else
     195     
     196    end
     197    W = textscan(w,'%s','delimiter','\n');
     198    W=W{:};
     199    web(['text://',...
     200      '<title>Update information and changelog</title>',...
     201      sprintf('<h1>Updated Aedes successfully to revision %d</h1>',...
     202      HeadRev),...
     203      sprintf('<h2>Updated files from revision %d to %d</h2>',...
     204      WorkingCopyRev,HeadRev),...
     205      sprintf('%s<br>',C{:}),...
     206      '<br>',...
     207      sprintf('<h2>Changelog from revision %d to %d</h2>',...
     208      WorkingCopyRev,HeadRev),...
     209      sprintf('%s<br>',W{:})]);
    219210  end
    220211 
     
    234225  % Update successful but with conflicts and/or merges
    235226  if isempty(c_ind)
    236         % Only merges
    237         fprintf(1,'\n********************* WARNING *********************\n')
    238         fprintf(1,['Updated to revision %d but with errors.\n',...
    239           'The following files contain MERGES:\n'],HeadRev)
    240         fprintf(1,'%s\n',g_files{:})
    241         fprintf(1,'***************************************************\n')
    242         if any(strcmpi(opt,{'prompt','semiprompt'}))
    243           h = warndlg({['Updated to revision ',num2str(HeadRev),' but with errors.'],...
    244                 '',...
    245                 'The following files contain MERGES:',...
    246                 '',...
    247                 g_files{:},...
    248                 '',...
    249                 'Contact the fellow in the About-dialog...'},...
    250                 'Updated with errors','modal');
    251           uiwait(h);
    252         end
    253        
     227    % Only merges
     228    fprintf(1,'\n********************* WARNING *********************\n')
     229    fprintf(1,['Updated to revision %d but with errors.\n',...
     230      'The following files contain MERGES:\n'],HeadRev)
     231    fprintf(1,'%s\n',g_files{:})
     232    fprintf(1,'***************************************************\n')
     233    if any(strcmpi(opt,{'prompt','semiprompt'}))
     234      h = warndlg({['Updated to revision ',num2str(HeadRev),' but with errors.'],...
     235        '',...
     236        'The following files contain MERGES:',...
     237        '',...
     238        g_files{:},...
     239        ''},...
     240        'Updated with errors','modal');
     241      uiwait(h);
     242    end
     243   
    254244  elseif isempty(g_ind)
    255         % Only conflicts
    256         fprintf(1,'\n********************* WARNING *********************\n')
    257         fprintf(1,['Updated to revision %d but with errors.\n',...
    258           'The following files contain CONFLICTS:\n'],HeadRev)
    259         fprintf(1,'%s\n',g_files{:})
    260         fprintf(1,'***************************************************\n')
    261         if any(strcmpi(opt,{'prompt','semiprompt'}))
    262           h = warndlg({['Updated to revision ',num2str(HeadRev),' but with errors.'],...
    263                 '',...
    264                 'The following files contain CONFLICTS:',...
    265                 '',...
    266                 c_files{:},...
    267                 '',...
    268                 'Contact the fellow in the About-dialog...'},...
    269                 'Updated with errors','modal');
    270           uiwait(h);
    271         end
    272        
     245    % Only conflicts
     246    fprintf(1,'\n********************* WARNING *********************\n')
     247    fprintf(1,['Updated to revision %d but with errors.\n',...
     248      'The following files contain CONFLICTS:\n'],HeadRev)
     249    fprintf(1,'%s\n',g_files{:})
     250    fprintf(1,'***************************************************\n')
     251    if any(strcmpi(opt,{'prompt','semiprompt'}))
     252      h = warndlg({['Updated to revision ',num2str(HeadRev),' but with errors.'],...
     253        '',...
     254        'The following files contain CONFLICTS:',...
     255        '',...
     256        c_files{:},...
     257        ''},...
     258        'Updated with errors','modal');
     259      uiwait(h);
     260    end
     261   
    273262  else
    274         % Both conflicts and merges
    275         fprintf(1,'\n********************* WARNING *********************\n')
    276         fprintf(1,['Updated to revision %d but with errors.\n',...
    277           'The following files contain CONFLICTS:\n'],HeadRev)
    278         fprintf(1,'%s\n',c_files{:})
    279         fprintf(1,'\nThe following files contain MERGES:\n')
    280         fprintf(1,'%s\n',g_files{:})
    281         fprintf(1,'***************************************************\n')
    282         if any(strcmpi(opt,{'prompt','semiprompt'}))
    283           h = warndlg({['Updated to revision ',num2str(HeadRev),' but with errors.'],...
    284                 '',...
    285                 'The following files contain CONFLICTS:',...
    286                 '',...
    287                 c_files{:},...
    288                 '',...
    289                 'The following files contain MERGES:',...
    290                 '',...
    291                 g_files{:},...
    292                 '',...
    293                 'Contact the fellow in the About-dialog...'},...
    294                 'Updated with errors','modal');
    295           uiwait(h);
    296         end
     263    % Both conflicts and merges
     264    fprintf(1,'\n********************* WARNING *********************\n')
     265    fprintf(1,['Updated to revision %d but with errors.\n',...
     266      'The following files contain CONFLICTS:\n'],HeadRev)
     267    fprintf(1,'%s\n',c_files{:})
     268    fprintf(1,'\nThe following files contain MERGES:\n')
     269    fprintf(1,'%s\n',g_files{:})
     270    fprintf(1,'***************************************************\n')
     271    if any(strcmpi(opt,{'prompt','semiprompt'}))
     272      h = warndlg({['Updated to revision ',num2str(HeadRev),' but with errors.'],...
     273        '',...
     274        'The following files contain CONFLICTS:',...
     275        '',...
     276        c_files{:},...
     277        '',...
     278        'The following files contain MERGES:',...
     279        '',...
     280        g_files{:},...
     281        ''},...
     282        'Updated with errors','modal');
     283      uiwait(h);
     284    end
    297285  end
    298286 
Note: See TracChangeset for help on using the changeset viewer.

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