Until now the graph was shown in a sepparate window. Now I’ve integrated it as an Eclipse View.
Also, now the code runs as a background task. Thanks to Steve Elsemore 🙂
Until now the graph was shown in a sepparate window. Now I’ve integrated it as an Eclipse View.
Also, now the code runs as a background task. Thanks to Steve Elsemore 🙂
The biggest challange in my GSoC project is the design and implementation of a cache system. Why a cache system is needed? For two reasons:
So what to do? The solution appears to be building a cache system. The cache will store information previously asked and also will store the information about branches in order to query easily for the whole history of a given file.
My cache design is based in an embedded database (Apache Derby) with the following structure.
I’ve decided to give a unique ID to each file. The same ID is shared with all its branches. So /trunk/Foo.java and /branches/2.x/Foo.java have the same ID. This table tells you for example:
/trunk/Foo.java was added in revision xxx, deleted in revision yyy and has the ID 123
With this table you can ask for exmple
Which ID has the file /foo/bar.c in revision 123?
And when you get the ID of a file you can ask for all its branches and when they were created.
There are other two tables: revisions and change_paths. These tables just store all the log information: author, revision number, date, action,…
When someone wants to see the graph of a file. I follow these steps.
The problem is that the first two steps can be high time comsumption tasks. But in my opinion the big goal is to make the third step as fast as possible. As I learnt in database design the queries are the most important. However I’ve thought about possible changes to improve performance.
To only use the “files” table. Storing just the branching information will make the cache smaller. With the information of this table you know when files were added, deleted and branched. The information about authors, comments, dates and M (modify) actions will be fetched on demand. This approach could have two steps. First building a simple graph with the branches and then the information about authors, comments,… could be loaded asynchronously.
To only store the log messages of selected files. This is, not to store all log messages but only the log messages of those files that are required to show the graph. This is the same than the previous approach but storing the log messeges once they have been fetched from the repository.
These approaches make the cache smaller. But they need to connect to the repository several times. I will only change my main approach to one of these if queries are slow.
My focus now is to resolve some bugs and improve the graphical part. This is, I want to integrate the graph into an eclipse view / editor and make it work with small but real-life repositories. I also want to show a progress bar while the cache is fetching information from the repository or while is calculating the IDs and branches.
These are the steps I took to have my environment ready for coding.
Once I set up the environment I made some changes in the source code and I tested it. I think the easiest change is adding a component in the preferences page. The source code for the preferences page can be found in the org.tigris.subversion.subclipse.ui.preferences.SVNPreferencesPage class. I added the second line in this example code:
showCompareRevisionInDialog = createCheckBox(composite, Policy.bind("SVNPreferencePage.showCompareMergeInSync"));
createCheckBox(composite, "foo bar");
Now you need to test that this code works. To do this open the plugin descriptor file (plugin.xml) for the org.tigris.subversion.subclipse.ui project. You’ll see an editor pane with many tabs at the bottom. In the default tab (Overview) there are two options for Testing: “Launch an Eclipse application” and “Launch an Eclipse application in Debug mode”. Click one of them. A new Eclipse application will be launched with your code changes. Now open the SVN Prefrences Page to see the changes.