Wilcox Development Solutions Blog

CVS Sucks

August 22, 2003

I love how every time I try to do something complicated with CVS it means I have to write another script. Today I was trying to merge a code update from a vendor into my tree. Now I do this about once a month for the VonTrapp project, but I usually have a few days to do that (it’s a lot of files, and it takes at least 2 afternoons to do all the conflict cleaning, etc). Today was a different task, and well, it’s a smaller code base so I’m happy.

Except CVS decides that, for about 10 files, that the whole file conflicts. That’s just lovely.

So I had to write an Applescript for BBEdit to compare the differences between the repository data and the local sandbox data. I didn’t think it was possible, but I just have this feeling that I’ll look at that code in 6 months and run away crying like a little girl.

Applescript is an english-like language, so I’m not completely sure how that all happened, but it feels unreadable to me.

Because you all want to see it, here’s one of the scarier parts..

`tell app “BBEdit” set localWindow to make new window with properties {name:filename & ” (local)”} set text of localWindow to localText save localWindow to file localPath without add to recent list —localWindow will be “text window 1”, and window 1 refers to active window —so must save one before the other. WD-rpw 08-21-03 set repoWindow to make new window with properties {name:filename & ” (repository)”} set text of repoWindow to repoText save repoWindow to file repoPath without add to recent list set compareRes to compare alias localPath against alias repoPath

end tell`

I could not tell you what scares me about this code. Maybe the verboseness. Or the fact that localWindow’s value is text window 1, meaning that when I create another window and make it frontmost that that window will be text window 1.

Or maybe that I can’t compare text windows, I have to save them to a temp file first.

To top that all off, I’ve got another cvs related script I have to write. It seems like every week I’m writting a new script for it. And while it makes me happy, I wonder if it will ever end…