You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Sylvain Wallez <sy...@apache.org> on 2004/11/03 09:14:10 UTC

[lazyweb] SVN checkout without keyword expansion?

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.

Thanks for any hint,
Sylvain

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


Re: [lazyweb] SVN checkout without keyword expansion?

Posted by Sylvain Wallez <sy...@apache.org>.
Jean-Baptiste Quenot wrote:

>* Sylvain Wallez:
>
>  
>
>>Sylvain Wallez wrote:
>>    
>>
>
>  
>
>>>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")
>>>      
>>>
>
>  
>
>>I  was totally  wrong with  this  statement: I checked  it using  "svn
>>status"  on  a file  that  was  missing the  svn:keywords  property...
>>Mmmh... need  to find something else...  and also write a  script that
>>automatically adds svn:keywords where it's missing :-)
>>    
>>
>
>I've got it already, FWIW:
>
>http://svn.caraldi.com/trunk/bin/svn-keyword-id
>  
>

Thanks Jean-Baptiste :-)

Sylvain

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


Re: [lazyweb] SVN checkout without keyword expansion?

Posted by Jean-Baptiste Quenot <jb...@anyware-tech.com>.
* Sylvain Wallez:

> Sylvain Wallez wrote:

> > 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")

> I  was totally  wrong with  this  statement: I checked  it using  "svn
> status"  on  a file  that  was  missing the  svn:keywords  property...
> Mmmh... need  to find something else...  and also write a  script that
> automatically adds svn:keywords where it's missing :-)

I've got it already, FWIW:

http://svn.caraldi.com/trunk/bin/svn-keyword-id

You  need  to pipe  the  result  of this  program  to  « sh » if  you're
satisfied with the proposed changes.
-- 
Jean-Baptiste Quenot
Anyware Technologies
http://www.anyware-tech.com/

Re: [lazyweb] SVN checkout without keyword expansion?

Posted by Sylvain Wallez <sy...@apache.org>.
Sylvain Wallez wrote:

> 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")


I was totally wrong with this statement: I checked it using "svn status" 
on a file that was missing the svn:keywords property...

Mmmh... need to find something else... and also write a script that 
automatically adds svn:keywords where it's missing :-)

Sylvain

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


Re: [lazyweb] SVN checkout without keyword expansion?

Posted by Sylvain Wallez <sy...@apache.org>.
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 }


Re: [lazyweb] SVN checkout without keyword expansion?

Posted by Giacomo Pati <gi...@apache.org>.
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.

-- 
Giacomo Pati
Otego AG, Switzerland - http://www.otego.com
Orixo, the XML business alliance - http://www.orixo.com

Re: [lazyweb] SVN checkout without keyword expansion?

Posted by Vadim Gritsenko <va...@reverycodes.com>.
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.
> 
> Thanks for any hint,

Hint:
   svn diff http://.../cocoon/trunk http://.../cocoon/branches/BRANCH_2_1_X

compares files without expanding any keywords at all.


Vadim