Giacomo Pati wrote:

On Wed, 3 Nov 2004, Sylvain Wallez wrote:

Hi all,

A lazyweb question about SVN: is there a way to perform a checkout without expanding the $Id$ keyword? I couldn't find one by googling around, and that would be so useful for merging branches where many files only differ by their revision number.

Currently I used a quickly hacked script that does the job, but that would be much cleaner to have it handled directly by svn.


I usually compare different branches by use of the following gnu diff command in a script:

diff -rubBd -x CVS -x target -x .svn -x .cvsignore -x .settings \
        -x .project \
        --ignore-matching-lines=\\\$Author: \
        --ignore-matching-lines=\\\$Date: \
        --ignore-matching-lines=\\\$Header: \
        --ignore-matching-lines=\\\$Id: \
        --ignore-matching-lines=\\\$Locker: \
        --ignore-matching-lines=\\\$Name: \
        --ignore-matching-lines=\\\$RCSfile: \
        --ignore-matching-lines=\\\$Revision: \
        --ignore-matching-lines=\\\$Source: \
        --ignore-matching-lines=\\\$State: \
        --ignore-matching-lines=\\\$Version: $* $TARGET $SOURCE

It is suitable for CVS as well as for SVN. Hope this helps.


Eeek! Thanks for the tip, but I prefer more graphical front-ends to reconcile changes :-)

I use Eclipse's diff utility by selecting the same folder in the two branches then "compare with/each other" in the contextual menu.

The nice thing about SVN is that it doesn't consider as having changed a file where "$Id: blah blah$" has been changed to "$Id$". Here's the script I use (named "rmkw" for "remove keywords")

#!/bin/sh
temp=rmkw.tmp
find . \( -name '*.java' -or -name '*.xml' -or -name '*.xmap' -or -name '*.js' -or -name '*.xsl' \) -print | while read file
do
echo $file
/usr/bin/sed -e 's/\$Id:.*\$/$Id$/' $file > $temp
mv $temp $file
done


Sylvain

--
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }



Reply via email to