As promised before, today I’m going to describe the basical concepts about the TimeLine, and how use it for the best developing experience, by giving you some examples.
The TimeLine is a powerful tool which allows you, as the name suggests, to “travel” into various states of your project called SavePoints. Let’s say that, during the developing process of an application, you are writing a method/feature and then you find out a new API which does that dirty work for you: so you need to cleanup your code and simply invoke that API. If the amount of new code you just wrote is small, you can simply Undo for each source file or, if you can’t, delete each related line of code, and then continue programming using the new API. But these operations are not trivial if that feature is deeply mixed in the code, or the number of files affected is high. It would be nice if you could revert your sourcecode in a previous state with one single mouse click. Of course the TimeLine can do that, by setting/deleting SavePoints.
What is a SavePoint and how to create it
You can think about it as a “photo” of the current state of your project: you can save as much states as you want, comment it for a later review, and also delete it. A TimeLine is simply a collection of these SavePoint, ordered in a chronological way.
When a new project is started within PlasMate, the TimeLine will look like the figure below:
Since the TimeLine is not created yet, the only entry displayed is “Not a SavePoint”, so let’s create our first SavePoint by clicking on it!
Here it is my example:
Every time you store a Savepoint, you have add at least a brief comment, so you can keep track of changes in your project.
After pressing Apply button, the TimeLine is initialized and your first SavePoint is saved; then, the TimeLine widget is updated and now displays with new info. If you move your mouse over the SavePoint, a popup will show you all the infos you need:
- Date and time of its creation;
- Author who created the SavePoint;
Certainly you noticed also a new item named “On Section: master”; don’t worry, I’ll talk about Sections later in this article
Well, now you know ho to create a SavePoint: usually, it’s a good practice to save it everytime you plan to start a new feature/add on.
So, a simple TimeLine layout could be something like this:
- SavePoint #0: added main script files;
- SavePoint #1: implemented settings interface;
- SavePoint #2: added resources files;
- SavePoint #3: implemente net services;
If you realize, as in the example i described in the beginning, that SavePoint #3 is useless because you discovered a function do_net_service(), you can delete your SavePoint in two different ways:
- Right click in the previous SavePoint: from the popup menu that will be showed, select “Restore SavePoint”; by doing this, all the subsequent SavePoint ( the one you want to delete, but also other saved after it, if present )will be deleted;
- Right click in the previous SavePoint: from the popup menu that will be showed, select “Move to this SavePoint”; with this command, you’re going back in the past: the wrong SavePoint, and a new Section is created.
Ok, now it’s time to introduce the concept of Section
What is a Section?
Do you remember the film Back to the Future ? When Martin travelled to the past and changed it, he discover that also the present has changed!
So, when a while ago you selected“Move to this SavePoint”, you made a trip back in time and PlasMate automatically asks you to create a new Section, in order to preserve the actual story ( saved in the Section called master ).
But the Sections are even more powerful! For example, you can use the master section to release the stable version of your app, and create a Section named devel used to develop more advanced ideas and not yet stable to be released. The interesting feature of Section is that they can me merged together; so, when your devel Section is stable enough, you can merge it with the “official” branch, and then you can delete it or continue with new cool ideas =)
Note that the TimeLine will show you only the current section, with its related commits !!
Example of a merge:
For any question or further explanations, feel free to ask me =)