Compiler Update - Version Control!


After a very successful beta, the mbed Compiler now officially supports built-in workspace Version Control!

You'll now see new "Commit" and "Revisions" buttons in the toolbar, and driving it should be pretty self explanatory, especially for those familiar with DVCS such as git or mercurial.

Here is the video that shows how you get started:

For anyone who missed the beta introduction, here are the main details:

Overview

You can use the version control features to let you version, branch and merge code, with a nice representation of the state of your project history:

http://mbed.org/media/uploads/simon/_scaled_version-control.png

The approach we're taking should be familiar to those of you with experience of distributed version control models (as used by mercurial/git); each program has its own local repository, so you can commit and perform actions on it within your own workspace (such as updating, branching, showing changes).

The main things you can do so far include:

  • Commit a version of your project, and view the revision history
  • View changes a version made, and compare changes between versions
  • Update or revert to a different version
  • Branch and merge

Note that you can't do any collaboration aspects with this yet; no pulling, pushing, named branches etc; it is all just local to your workspace project for now. But you can guess what we're working on next...

The Basics

Your program, as before, is the "Working Copy". You can "Commit" changes to its local repository to create new "Revisions". You can see the changes between your current working copy to the previous revision, and changes between revisions.

/media/uploads/simon/_scaled_screen_shot_2011-06-14_at_21.08.49.png

You can choose to "Update" to a particular revision, which updates your working copy to that revision (e.g. a state of your program in the past). This is the way you can "Branch"; do some commits, update to a previous revision, do some more commits; you now have two branches of development derived from a common revision.

You can then "Merge" a revision, often the head of one branch, in to your working copy. This creates a working copy that is the merge of these two branches, and when you commit, your back to one (less) branch of development.

There is also the option to "Discard" your working copy, and "Revert" your working copy to a particular revision; unlike "Update", this creates a working copy with the changes you need to get back to that previous state, more like an "undo" than a branch.

We hope you find this useful!

10 comments on Compiler Update - Version Control!:

28 Jul 2011

That RULES. Thank you!!!!! Can't wait to make use of it.

28 Jul 2011

Good! Now the only thing that is still missing is to have access to the repository from the outside world so that we can edit offline and push the changes to your systems before compiling. ;-)

Thanks,

O.

28 Jul 2011

Sounds like a great step forward :)

28 Jul 2011

How do the compare/changes features differ and how do I use them? I've committed a file three times, I'm trying to see the differences between the newest two but all I get is the latest version all in green then the older version in red, not line by line comparisons.

28 Jul 2011

Perhaps repository integration with dropbox ?

02 Aug 2011

How can I disable compiler revision control!

02 Aug 2011

Hi Klaus,

If you never commit a revision, no history will ever be created! So a program is just as before until you add a commit to that program.

Thanks, Simon

06 Aug 2011

Is it possible to access the version information from within the source code files?

I would like to be able to print the program version as part of a sign-on message. I want to be able to do something like:

    printf("\My program (Version %s, %s %s)\n",
       VERSION, __DATE__, __TIME__);
06 Aug 2011

Paul - not just yet, but that's a good idea! Will see if this can be added to the todo list for a release in the near future.

Dan

29 Aug 2011

The version control feature is very useful and easy to use. You've done great work on this. I did not look at your tutorial. I just jumped in and used it and it worked very intuitively.

You need to log in to post a discussion

Questions