Source Control.

advertisement
Joe Healey and Richard Gibson.
Source Control.
Source control, also known as version control and revision control, is a protocol (e.g.
subversion SVN) that tracks file/code, allowing numerous users to edit a communal
code whilst retaining the original and each revision. The advantages of this are that
programmers can work on di↵erent aspects of the code without interfering with each
others work. Source control also allows the users to go back to previous versions of the
code if a problem arises, as well as providing a remote backup. Additionally, source
control allows users to make changes regardless of their geographical location. The
protocol will also track who made the changes.
In a source control system, the file/code
and all subsequent developments will be saved
in a folder, known as the repository.
This
folder will generally be stored on a server,
where users can check out saved versions of
the code, known as the working file (server
alternatives may include commercial clouds
or public SVNs).
Once the users has
made amendments to the code he is then
able to check in/commit the amended code,
which will then be available to all other
users.
The direction of development from the source
code to the final code is known as the trunk.
The development of the source code will follow
this trunk, with the development of any duplicates
forming an o↵ shoot known as a branch. The developments of the duplicates will then follow the
direction of the branch, with the branch either
merging with the trunk (if the development of the
duplicate is integrated/merged with the development of the original code) or becoming terminated (if these revisions are not integrated
the development of the original code).
SVN is the common protocol used by many applications, though has been somewhat
superseded by GiT. ’Proper’ implementation of ubiquitous SVN is done via terminal,
but is quite an involved process. Matlab provided GUI (a more user friendly interface)
to make this process easier.
How to set up source control for MATLAB.
1. Create an empty folder, at a desired location, to use as the repository.
2. Enter MATLAB and then go to systems preferences in the MATLAB toolbar.
1
Joe Healey and Richard Gibson.
3. Click on general, then source control. Change the preference to custom.
4. On the MATLAB tabs select Home. Then choose New > Simulink Project >
Blank Project.
5. Choose your project name and store in a desired location (that is not in the
repository).
6. Click on Source Control in the project menu, select built in SVN 1.7 and set
the repository location to your empty folder (created in step 1). Click validate,
MATLAB will perform some checks, and then click convert.
7. Add the files that you want to make available to other users to the project files
(drag and drop).
8. When you want to add a modified file to the repository click on modified files on
the project menu.
9. Select the modified file(s) that you wish to upload and click commit modified files.
Links.
• Since SVN is no longer bundled in OS X past 10.7, download Xcode.
• A complete textbook guide to SVN is available here:
http://svnbook.red-bean.com/en/1.7/svn-book.pdf
• A useful wikihow guide on installing/testing your SVN state:
http://www.wikihow.com/Install-Subversion-on-Mac-OS-X
• A very useful walkthrough for setting up SVN servers via the Terminal:
http://svn-ref.assembla.com/subversion-server-guide-mac-os.html
• A GUI alternative to managing your Repository: svnX
• MathWorks Links to setting up SVN Source Control:
1. http://www.mathworks.co.uk/help/simulink/ug/select-subversion-source-control.html
2. http://www.mathworks.co.uk/help/simulink/ug/retrieve-a-working-copy-ofa-project-from-source-control.html
3. http://www.mathworks.co.uk/help/simulink/ug/commit-modified-files-to-sourcecontrol.html
4. http://www.mathworks.co.uk/help/simulink/ug/review-changes.html
5. http://www.mathworks.co.uk/help/simulink/ug/add-files-to-the-project.html
6. http://www.mathworks.co.uk/help/matlab/matlab prog/set-up-source-controlmicrosoft-windows.html
2
Download