Archive for the ‘subcommander’ Category
just wanted to let you know that I’m still working on Subcommander :-)
I’m still rewriting the working copy (custom implementation of QAbstractItemModel) code using test driven development. A couple of days ago I modified the gui to use the new code for the first time. And it worked nearly out of the box :-) Because of the test coverage caused by using tdd it will be a lot easier to maintain and extend in the future.
The next step is to add the working copy filtering code to my own custom QAbstractProxyModel. The Beta 5 code is based on QSortFilterProxyModel and I was unable to get it to do what I want. The way QSortFilterProxyModel handles the QModelIndex stuff simply does not fit with my code. Debugging it was just crazy.
When that’s finished (will be beta 6) I will be able to work more on features and visible improvements instead of internal design stuff.
What else? I have set up a (private) Hudson build of the Subcommander /trunk. It is running subcommanders google mock based test suite, checking coverage with gcovr (I had to tweak it a little bit) and is running a code analysis using cppcheck. Cool ;-)
Subversion mingw port
I’m also working on a port of subversion to mingw. My final goal is to build Subcommander on Windows with mingw. I have a patch to build subversion on mingw but there are still some failing tests.
Since I didn’t work on it for a couple of month I’m now trying to upgrade the patch to subversion trunk….
Progress is slow but steady… maybe I’m trying to do too much ;-)
I have updated the the source archive for b5 to b5 patch 2. It fixes a couple of build warnings for newer gcc versions, a bad signal/slot connection, (adds) a simple url check (file:////..) to avoid a crash before passing the url to the svn api, a crash on Linux when opening the bookmark property dialog and a missing application icon on Linux.
It is online at http://subcommander.tigris.org.
In my current work of tdd’ing any new subcommander code (clean code of course :-) I want to create some test code that leads me to a class that compares the old working copy status and new working copy status of a single directory to notify only items to the gui that have changed.
I hope to achieve a much smother and faster working copy view this way. The updates will be fed to a new QAbstractItemModel implementation that provides the data for the working copy view. Currently I have about 50 tests that exercise the item model implementation and its helper classes.
I guess this is a ridiculous number of tests for a single interface implementation and a couple of helper classes!? It is not even fully implemented yet. I wonder if forcing any code line by test code is a little bit to much…
I also wonder if there are tests I could remove because “their” code (that is the production code I wrote because of the test) is now hit by other more interesting tests.
Back to wc (working copy) status. The wc status information of any single item is represented by a svn::WcStatus object. When I created the class a few years ago I didn’t want to have it a lot of setter methods. So I passed an svn_wc_status2_t* pointer to its constructor and it extracts all information from it. svn_wc_status2_t is struct from subversions api which contains all the status info.
WcStatus (const sc::String&, svn_wc_status2_t*);
Great or better not great, this is bad for testing. I don’t want to setup an svn_wc_status2_t struct just to create a couple of WcStatus objects for testing. I need a WcStatus without it. Tdd’ing the new code has to wait. First I need to break some dependency.
Typically you would do an extract interface here. Or even better, as I want to keep WcStatus as the interface name, it is used everywhere in the code, extract implementer (Working Effectivly with Legacy Code).
This is easy and straightforward:
- copy WcStatus.h to WcStatusImpl.h
- move WcStatus.cpp to WcStatusImpl.cpp
- rename the class to WcStatusImpl in WcStatusImpl.h and cpp
- #include and derive WcStatusImpl from WcStatus
- Remove the constructors and fields from WcStatus.h
No problem, easily done even without ide support. At this point it compiles again but it does not link. There is one annoying step left. You have to make all methods pure virtual in the interface. It is a bit boring to add the virtual and = 0 to 25 methods…
But with this rather small refactoring I have improved my code:
- There is now one dependency less in my old legacy code which allows me to implement WcStatus test doubles
It is only a small improvement, but it is an improvement.. :-)
I have uploaded b5 binaries for MacOSX. They are built against subversion 1.6.6.
The binaries are available at http://subcommander.tigris.org.
I have updated the b5 Windows Installer to fix the startup problems with the “The application failed to initialize properly (0xc0150002)” error message.
Unfortunately my binaries were linked against the release AND the debug run time. Which is a really bad idea.
The new installer is online at http://subcommander.tigris.org.
Thanks for reporting the startup issue :-)
I have updated the the source archive for b5 to b5 patch 1 (version numbering gets crazy now.. :-). It fixes a couple of build issues for gcc newer than 4.0. I added a few additional #includes and fixed an #include case error.
It is online at http://subcommander.tigris.org.
Thanks to everyone for reporting the build issues :-)