First, I know I could set up a non-server svn repository in my
bazooka file system just like we set up CVS, but I'm trying something
different.
The dreamhost control panel has a tool for installing a subversion
repository accessible through Apache.
1. I created a subversion repository called "hello world" with
subdirectory hw01. I requested public read access. There is a
facility for users that I can manage. This has nothing to do with
shell account users, but I made an account for myself.
2. I looked in my directory using my shell account, and found a
directory called svn/hw01. Inside this directory was a set of files
making up a svn repository that looks very similar, if not exactly
the same, as any subversion repository. The files owner is the apache
user, and the group is the group name I was was given when I created
the account.
3. I created a directory and wrote the familiar hello world program.
Then I executed the command:
svn import . http://www.fractint.net/hw01
Voila! A publically visible repository with my hello world program
accessible at http://www.fractint.net/hw01
4. I installed the subversion tortoise on my PC. Fortunately it can
co-exist with the CVS tortoise. I checked out the repository. This
worked fine, I was not prompted for a password.
5. I locally edited hello.c and committed. This time I was prompted
for username/password
6. The web interface now shows the edited file.
Anyone can check out files using any subversion client or the web
interface. I can create accounts for people to give them commit
permission. Or if we don't want public access, it can be limited to
the accounts.
One possibly very big problem - I don't know how to import a whole
repository with versions. I have no control over the apache ownership
of files, so I can't just copy (nor do I think it's appropriate to be
directly manipulating the subversion data base anyway). If we convert
the existing CVS repository, I don't know how to give the files the
right ownership. I'm looking to see if there's a subversion command
to bring in a whole repository with versions. Obviously I CAN import
all the files without the history.
None of this is a show stopper since ssh access method we are using
now will still work with subversion; however the server access looks
better in several significant ways: better security, better anonymous
read-only access.
Tim
Working in FractInt really makes me miss objects. C++ is backwards
compatible with C as long as you avoid variables called 'new' and
so-on. I've already refactored the identifiers that conflict with C++
keywords not present in C.
So what I'm thinking is that I'll just take all the *.c files on the
branch and save them as *.cpp. Then address any compile errors or
warnings that might result. It will still be a gigantic 1990-style C
program, but now when we add new code we can add it as objects.
Existing code can be incrementally refactored(*) into objects.
This is the approach I intend to take on the source. It won't happen
overnight. But slowly, gradually, the code will move to objects and
interfaces with locally encapsulated state that will allow the engine
to be repurposed in many, many ways... I don't care so much if the
DOS UI dies, but I want to see the parameter file stuff, the formula
stuff and the fractal types live on (and probably some other stuff
too, but I'm not trying to make an exhaustive list here).
Any thoughts are welcome...
(*)
I should be specific with the word "refactor" here as it can have just
the English language intuitive meaning of re+factor, but in software
engineering it means something specific. A refactoring is a change
to the structure of the code that preserves the behavior of the code
to all callers (implementation may change, but behavior is preserved).
For examples of specific code transformations that are considered
refactorings, take a look at <http://www.refactoring.com/> and browse
the "Catalog" link at the top of the page.
So how do you know if the behavior has been preserved across the change?
Unit tests. That might sound like a bunch of extra work, but reading
the book "Working Effectively with Legacy Code" by Michael Feathers has
convinced me it can be done to an existing body of code like FractInt
in an incremental fashion.
<http://www.amazon.com/Working-Effectively-Legacy-Robert-Martin/dp/013117705…>
<http://www.objectmentor.com/resources/books.html>
--
"The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download
<http://www.xmission.com/~legalize/book/download/index.html>
Legalize Adulthood! <http://blogs.xmission.com/legalize/>
Since the solution and project files differ between 2003 and 2005 and
I've just switched to 2005, I've added alternate solution/projects for
2005. Just load fractint.2005.sln for 2005 and fractint.sln for 2003.
--
"The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download
<http://www.xmission.com/~legalize/book/download/index.html>
Legalize Adulthood! <http://blogs.xmission.com/legalize/>