Robochameleon  v1.0
Functions
increaseClassVersion.m File Reference

Robochameleon utility to increase class version safetly. More...

Go to the source code of this file.

Functions

function increaseClassVersion (in classInputText, in varargin)
 Increase the class version safetly and creates a new class file. More...
 

Detailed Description

Robochameleon utility to increase class version safetly.

This utility creates a new file with an increased version number and changes all the internal references to the previous version number in an automated way. If the target file is in the MATLAB PATH the script can be from any folder, and the new file will be placed in the same folder as the original file.

On unix systems it also checks that the source file is git-clean (no modifications present). In both Linux and Windows it provides instructions on how to properly increase the version number without loosing modifications tracking in git.

The proper way to proceed is:

  1. Stash your files.
  2. Call increaseClassVersion
  3. Add the newly created class file to git and commit.
  4. Call increaseClassVersion with the 'force' option to apply uncommitted modifications on the new file.

Example:

% From the directory where the class file is located
% Case 1: File is git clean
% Case 2: Uncommitted modifications on the file
% Git stash
% Git add and commit the new file
% Git apply (unstash)
increaseClassVersion MyClass_v2 'force'

Definition in file increaseClassVersion.m.

Function Documentation

function increaseClassVersion ( in  classInputText,
in  varargin 
)

Increase the class version safetly and creates a new class file.

Parameters
classInputTextThe class name or the class file name
varargin{1}Force flag. If 'true' force overwriting the destination file and ignore git checks. Possible value: {'force'}. [Default: disabled]