Workspace Version Control

18 May 2011

Hi,

We're working to include version control in mbed to help with code development, and eventually as a backbone to collaborative development.

The approach we're taking should be familiar to those of you with experience of distributed version control models (as used by mercurial/git); we want each program to have its own local repository, so you can commit and perform actions on that totally within your own workspace (such as updating, branching, showing changes). You can then publish changes or pull changes from another (often centralised) repository, to enable collaboration.

If you have an understanding of some of these concepts, we'd be interested if you want to try out what we have so far. Given there is no public documentation yet, it'll be interesting to see how you get on and will in some ways be a good test of the UI!

The main things you should be able to do so far are:

  • 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.

To give you some clues, here is a quick outline:

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.

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.

/media/uploads/simon/_scaled_version-control.png

We've put it live on our beta site, so if you want to test it out, you can enable betamode by visiting this link and following the instructions:

The beta is a beta for a reason, so of course we don't recommend you use this on active/important projects quite yet. Please try it out, see how you get on, and report back here with any thumbs up, bugs, comments, etc...

Have fun!

Simon

18 May 2011

This is really exciting Simon.... perfect timing too.

BETA ON ;-)

Thanks, Serge

18 May 2011

There are a good number of other general compiler enhancements/fixes in there too, so please report anything that doesn't work as it should.

21 May 2011

Hi Simon

I like the cancel feature during compile!

It looks like there is a change to the way Compile works on edited files. If you were editing a file, Compile would save the file and then compile. Now, if you click Compile without saving first, then Compile just hangs - this is all after a commit as a starting point.

Is this by design?

Regards

21 May 2011

Hi,

That functionality should not have changed, so it is a potential bug on the beta. However, I just had a quick try and couldn't repeat it (new program > commit > edit > compile worked fine), so it may be a little more subtle than you report.

I'll log something. If you do find a sequence that causes this, I'd be very grateful - it is certainly not by design.

Simon

21 May 2011

Hi Simon

I can't repeat it now either, but I'll let you know if I can reproduce it.

A comment on the file compare ...

I'm used to using winmerge and guiffy where files being compared are shown side by side, and I find having all changes (both additions and deletions) in one file confusing. Any chance of a split window view for comparing revisions?

Regards

21 May 2011

agree split window for difference compare is nice. I use tortoise SVN for my stuff usually and would love to see something similar here. Good Work.

22 May 2011

Great stuff, thanks. Please keep testing and fire any feedback/bugs here. We'd like to ensure it is both stable and useful!

Simon

22 May 2011

I'm new to version control so I could be approaching this from the wrong angle but if I want to copy paste some text from an older version (or some highlighted changes) back into the current version I thought I would be able to select it and copy paste using ctrlC ctrlV. However this includes the line numbers. Should they not be excluded ?

Update: Duh - The way to do this is click on the line number and then you have the original to cut/paste from....

Don't think you can delete your own posts can you or this one would be gone !

K

22 May 2011

No problem, it's still worth mentioning if something isn't as intuitive as it could be!

In Chrome you are prevented from selecting the text which might eliminate that potential source of confusion - I'll see if it's possible to extend that to other browsers.

01 Jun 2011

Anyone else have comments/bug reports on the Workspace Version Control beta?

We're going to put a next version up on beta soon with a bunch of improvements, so want to try an fold in as much as possible. If you are sitting on some bugs/comments, please share!

Thanks, Simon

28 Aug 2011

I have 2 projects (both based on NetServices) which fail to Commit, although they compile error free and execute properly. The error is - "There has been a problem while committing your project". No further details. How should I proceed?

30 Aug 2011

Hi Donald,

I think the best thing to do here would be to log a support case - email support@mbed.org. Then we can work with you to investigate the problem.

Many thanks,

Dan