How does it all work?
LiveJournal source code is stored in several separate SVN repositories. The files
from these are merged into a single live tree. The live tree is your home
directory. It contains the code that actually runs on your server. This is the
code you edit and play with. The SVN trees are all stored below
…/cvs directory is a holdover,
from when the LiveJournal project used CVS for version
cvsreport.pl script lets you update the SVN
trees with the newest code, copy new files from there to the live tree, create
patch files for submission, and more.
Typically, you keep your SVN trees up-to-date, updating them every now and then. You use cvsreport.pl to copy new stuff from the SVN trees into the live tree, while being careful not to overwrite files in the live tree that you have been working on. You edit source in the live tree, test it on your server, edit again, test again and so on. At some point you create a diff of your changed/added files in the live tree against the up-to-date SVN trees, and you submit it. All these actions are explained in detail below.
Use your preferred text editor to edit your source code. Make sure you
Unix style line-endings, UTF-8 encoding, and spaces
Resetting your database. If you have totally messed-up your database and want to re-create it from scratch, do:
Staying up to date with SVN.
It's important to make sure you're developing against the latest
“trunk” code, when making changes and contributing patches.
Every so often, update from SVN:
… but that's not all.
The above only updates your
directory to be
current. It does not affect your live tree. For that, you also use
Merging your live and
See what's changed where:
|main -> cvs cgi-bin/ljlib.pl|
|main <- cvs htdocs/create.bml|
In the example you can see
newest in your SVN tree, and
cgi-bin/ljlib.pl is newest
in the live tree (where you should be working).
But maybe you have been working on
also and don't want to lose your changes. So, use
cvsreport.pl to make a diff and store it somewhere.
cgi-bin/ljlib.pl(two files in one diff)
-d(without filenames, puts all changes in all files in one diff)
Say you want to copy your
cgi-bin/ljlib.pl to the
SVN tree (under
Maybe later fifty files change in SVN, but you have a few files in your
live tree that are not ready to go into your
(Only syncs stuff from
That's the command you will probably want to run the most often. There
is usually no reason to copy files from your live tree to
tree (you might think
you'd do that to create a diff with svn diff, but
-d is easier and creates diffs
just the way we like them).