Subversion 1.4 goodies
Labels: diff, subversion
Subversion 1.4 contains a nice gem that I discovered only last week.
deepak@[~/code/statuspage]: svn diff -c 178
Index: data/quotes.xml
===================================================================
--- data/quotes.xml (revision 177)
+++ data/quotes.xml (revision 178)
@@ -56,5 +56,9 @@
<text><![CDATA[<p>Ideas are more powerful than is commonly understood. Indeed, the world is ruled by little else. Madmen in authority, who hear voices in the air, are distilling their frenzy from some academic scribblers of a few years back.</p>]]></text>
<source>John Maynard Keynes</source>
</quote>
+ <quote>
+ <text><![CDATA[<p>Many a man fails as an original thinker simply because his memory is too good.</p>]]></text>
+ <source>Friedrich Nietzsche</source>
+ </quote>
</quotes>
The svn diff -c can actually show you the changes made by a specific revision in the form of a diff. What is even better is that if you pass a negative value it can show you a diff which can be patched against your working copy to undo the change.
deepak@[~/code/statuspage]: svn diff -c -178
Index: data/quotes.xml
===================================================================
--- data/quotes.xml (revision 178)
+++ data/quotes.xml (revision 177)
@@ -56,9 +56,5 @@
<text><![CDATA[<p>Ideas are more powerful than is commonly understood. Indeed, the world is ruled by little else. Madmen in authority, who hear voices in the air, are distilling their frenzy from some academic scribblers of a few years back.</p>]]></text>
<source>John Maynard Keynes</source>
</quote>
- <quote>
- <text><![CDATA[<p>Many a man fails as an original thinker simply because his memory is too good.</p>]]></text>
- <source>Friedrich Nietzsche</source>
- </quote>
</quotes>
Doesnt all version control software have this? cvs diff -r.12 -r1.13 shows what 13 did. Drop the last arg and it diffs with your copy. Also I dont think you have -c -178 right... it is the diff between 178 and 177, not your current copy (-c is short for -r between consecutive revisions).
- saurabh
Post a Comment