Share via


Small Basic: Revision Control

This article illustrates revision control with [[Small Basic]].  Revision control is always useful but especially when multiple developers are working on the same project.


Revision Number in Program ID

Program ID is allocated when you [Publish] your program.  Program ID format is xxxnnn, while x is an uppercase alphabet (excluding A, E, I, O, U, Y) and n is an digit from 0 to 9.  When [Publish] after [Import], revision number suffix is added as xxxnnn-n.  The first revision number is -0.  And the next of -9 is -10.

Publish Error

Program size can be published is limited about 2500 lines.  If the Small Basic program is too large, following error message will appear at [Publish].  One of workarounds for this issue is to remove all comments and publish again. 

Advanced Trial with Revision Control Tools

General revision control tools have such ability to compare between two revisions of the source codes.  For example, Git Gui explained below can manage any kind of source code including Small Basic.  Git Gui can save revision information as local repository and also as remote repository.   For remote repository, there are many services on the internet.  This article introduces CodePlex as a remote repository., 

Git Gui

Git was developed as a Linux command for revision control.  Git Gui is the graphical user interface of Git command. 

Preparation for Local Repository

Prepare local repository as following instructions.

  1. Download Git Gui by going to http://git-scm.com/downloads and clicking Windows.
  2. Push [Run] button to run the installer.
  3. Wait until security scan completed.
  4. Push [Yes] button to allow running the installer in UAC (User Account Control) window.
  5. Push [Next] button in Git Setup Wizard window.
  6. Read the license and push [Next] button.
  7. Push [Next] button.
  8. Push [Next] button.
  9. Push [Next] button.
  10. Push [Next] button.
  11. Push [Finish] button.
  12. Read the release notes and close WordPad.
  13. From [Start] screen, go to Apps screen and click [Git GUI] icon to start Git Gui.
  14. Click [Create New Repository] link to create a new repository for your source code.
  15. Type your source code full path or push [Browse] and select the source code folder.  And push [Create] button.
  16. Then you can see Git Gui main window.  There are five buttons [Rescan], [Stage Changed], [Sign Off], [Commit] and [Push].  These five functions are the main function of this tool.
  17. Select [Edit] > [Options], type User Name, Email Address, select utf-8 for Default File Contents Encoding and press [Save] button.

Rescan

After you update source code with Small Basic IDE, push [Rescan] button to refresh Git Gui for recognizing newest files.  Changed files are displayed in [Unstaged Changes] pain.  So, this action is not needed at the first time just after creating new repository. 

Stage Changed

Then push [Stage Changed] button to select files to inform for Git Gui to update the repository.  If you see following popup, push [Yes].  Then files are moved to [Staged Changes] pain.

Sign Off

Type comments about this revision (version) in lower right text box, and push [Sign Off] to add signed-off message after the comments.

Commit

Push [Commit] button to synchronize staged files with local repository.  After commit, files listed in [Staged Changes] and comments will disappear.  

Visualize History

By selecting [Repository], [Visualize master's History] from the menu, you can check the history of revisions in the repository.

Preparation for Remote Repository

Before following instructions, you should setup remote repository such as CodePlex or GitHub.

Clone

Select [Clone Existing Repository] to get remote repository into local repository.

Type remote repository location into Source Location.  Type local source directory into Target Directory or push [Browse] and select the folder.  Then push [Clone].

Merge

Select [Merge] > [Local Merge] to merge remote repository into local repository.  This action is not needed at the first time just after cloning the repository.

Push

Press [Push] button to reflect local changes to remote repository.

CodePlex

CodePlex is Microsoft's free open source project hosting site.  You can create your remote repository on this site.  Small Basic program listing server has some limits to upload source code as follows.

  • Maximum size of the source code is about 2500 lines.
  • Lines with File objects are commented out.
  • Some text constants (such as "<" and "<") are not displayed correctly in the program listing server.

But CodePlex doesn't have these limitation.  Visit https://www.codeplex.com/ with your browser.

Preparation

These instructions are needed only once at the first time. 

  1. Select [Register] link in the top, and select [Microsoft account].
  2. Sign in with your Microsoft account.
  3. Then you can enter your page in CodePlex.

Clone from Remote

Following project is a sample including a Small Basic program.  The URL is https://smallsvgeditor.codeplex.com/ .

Select [SOURCE CODE].

Select [Clone].  Then you can get an URL to download remote repository to local.  This will the input of Source Location in Git Gui.

Other functions in CodePlex

CodePlex has following useful functions. These will help team programming.

  • Documentation
  • Discussions
  • Issues

See Also

Other Resources

Other Languages