jMonkeyPlatform: Version Control

Whether you work in a development team or alone: File versioning is a handy method to keep your code consistent, compare files line-by-line, and even roll back unwanted changes. This documentation shows you how to make the most of the jMonkeyPlatform's integrated version control features for Subversion, Mercurial, and CVS.


Note: Since the jMonkeyPlatform is based on the NetBeans Platform framework, you can learn about certain jMonkeyPlatform features by reading the corresponding NetBeans IDE tutorials (in the "see also links").

Version Control Systems

The jMonkeyPlatform supports various Version Control Systems such as Subversion, Mercurial, and CVS. No matter which of them you use, they all share a common user interface.

You can use file versioning alone or in a team. The advantages are that you can keep track of changes (who did it, when, and why), you can compare versions line-by-line, you can revert changes to files and lines, merge multiple changes to one file, and you can even undelete files.

Creating a Repository (Upload)

Requirements:

Now you create a repository to store your project's files.

  1. In the jMonkeyPlatform, right-click the project in the Projects window and choose Versioning > Import Into CVS/Subversion Repository (or initialize Mercurial Project, respectively).
    • Tip: If you haven't evaluated yet which system to choose, start with Subversion for now.
  2. Go through the wizard and fill in the fields to set up the repository.

Checking Out a Repository (Download)

You and your team mates check out (download) the repository to their individual workstations.

  1. Go to the Team menu and choose Subversion > Checkout (or CVS/Mercurial>Checkout respectively)
  2. Fill in your repo data into the wizard and click Finish.
  3. The repository is downloaded and stored in the location you chose.
  4. Use the File > Open Project menu to open the checkout as project and start working.
    • If the checkout is not recognized you need to choose File > New Project from Existing Sources


Of course you can also check out existing repositories and access code from other open-source projects (e.g. SourceForge, GoogleCode, dev.java.net).

Updating and Committing Changes (Send and Receive)

Receiving the latest changes from the team's repository is referred to as updating. Sending your changes to the team's repository is refered to as commiting.

  1. Before making changes, right-click the project and select Subversion > Update to make sure you have the latest revision.
    • Get in the habit of updating regularly, always before you edit a version controlled file. It will spare you much grief.
  2. After making changes to the project, make certain your change did not break anything.
    1. Update, build, run, test.
    2. Look at the red/green/blue marks in the editor to review what you have deleted/added/changed. Click the marks to review all differences in a file.
    3. Choose Subversion > Show Changes to see all files that were recently changed – by you and other team members.
    4. Update again in case your team mates made changes while you were reviewing.
  3. If there are no conflicts and you want to commit your changes, choose Subversion > Commit from the menu.
  4. Write a commit message describing what you changed.
    • Remember, you are writing "a message to your future self". Never write redundant stuff like "I changed something".

Comparing and Reverting Changes

No Version Control? Local History!

If you do not use any version control, you can still track changes in projects to a certain degree.


See also:

view online version