Friday, November 21, 2008

Subversion revision history, Perforce style

I don't have a ton of confidence in Subversion, and am fairly comfortable with Perforce, so when Subversion doesn't obviously do something I know how to do in Perforce, I tend to throw my hands up in the air and say, "See? Subversion sucks!"

This, I'm coming to believe, is a bad habit. Case in point: change history - Perforce vs. Subversion. In Perforce, you do the following (of course, there are flags to get more or less information):
p4 changes (path)
p4 describe (change number)
In Subversion, you get the changes this way:
svn log (path)
That's fine, but now how do you get information about what changed? Cue throwing my hands up and cursing the tool. "How can I make log tell me about what changed," I'd think. But, as is often the case (and the sooner I realize this, the better for everyone), I'm not thinking about the problem correctly. Perforce requires you use two different commands to get the information I require. Why wouldn't Subversion? The only wrinkle is that Subversion doesn't appear to have a dedicated utility for "describing" a change. Rather, you use the diff utility thus:
svn diff -c(change number) (path)
or, to find out all of the changes committed at a certain revision number
svn diff -c(change number)