Version Control

Introduction

The Iguana Translator’s built-in version control means that you can save script changes whenever you need to. This enables you to make changes with confidence, as they can be reverted whenever necessary.

When you save a script, all the associated files and script modules are also saved. This collection of saved files is called a Commit.

Another major advantage of version control is that you can only run a channel using a specified commit, so you always know the exact code the channel is using.

Tip: If your amazing new bug fix doesn’t seem to be working when you run the channel, check that you actually saved a commit!

Create a Commit [top]

When you create a commit all the associated files and script modules are included.

  1. Click the Commit to source control button, on the toolbar:
  2. Enter a description of the commit into the Add a note about this commit field:
  3. Click Commit Files to save the commit.
  4.  Select the channels to run using this commit (they will be updated and restarted):
    Note: The channel you are currently editing is first in the list.

Tip: Adding Business Logic to a utility function like string.split() is bad function design. If we want the HL7 default behaviour we should use a wrapper function like string.hl7Split().

Restore a Commit [top]

To rollback changes you need to restore the commit before the changes were added.

Note: You can always ignore the second file in the project: project.prj. This file is generated by the Iguana to specify the files are displayed in the Project Manager panel.

  1. Click the View commit history button, on the toolbar:
  2. Identify the commit where the changes were added (in this case we only changed shared/stringutil.lua):
    • Use the Project files at this commit list (in the lower left pane) to  check the file(s) you changed and confirm your changes.
    • Check all the modified files on the list in case there are other changes you do not wish to roll back.
      Note: Files in italics were not changed in this commit.
  3. Select the previous commit.
  4. Preview the reversions using Changes Only plus Preview revert:
    • Check the changed file(s) to ensure the reversions are correct.
    • You should check all the files in the Project files at this commit list in case there are other changes (from later commits) that you do not wish to roll back.
  5. Once you are happy with changes, click Revert.
    Note: If you are unhappy with the changes (after you click Revert) you can simply revert back to the previous commit.

View Differences [top]

When you select a commit in View commit history it shows you the changes from the previous commit.

  1. Click the View commit history button, on the toolbar:
  2. Select the commit that you are interested in.
  3. View the changes in the compare pane on the bottom right:

When you create a commit in Commit to source control it shows you the changes between the previous commit and the code in the Editor.

  1. Click the Commit to source control button, on the toolbar:
  2. View the changes in the compare pane on the bottom right:

Icons indicating code changes [top]

When using the Iguana Translator, you can save a Commit at any time.

To help you track code changes in the editor, these icons in the Project Files panel indicate when files are added or changed:

Icon Meaning
This yellow (!) icon indicates that a file was changed since the last commit.
This green (+) icon indicates that a file was created since the last commit.

Tip: In the Dashboard the yellow (!) icon indicates any project change (new/changed file):