You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Peter Strempel <zo...@web.de> on 2004/09/25 15:12:46 UTC

Checkout/Export without keyword substituion

Hello,

is there a way to suppress keyword substituion during checkout or 
export, like the CVS -kk switch?

I have a lot of files with the $Id$ keyword in the header. Those files 
have the "svn:keywords Id" property set. So when I checkout, the $Id$ 
keyword is replaced. Fine, that's how it's supposed to work.

However, occasionally I need to do an export without the keyword 
replacement (I need this to synch the whole code with a remote CVS 
server). With CVS I'd just do "cvs export -r HEAD myproject -kk", and 
the $Id$ stays $Id$.

I currently see two approaches for this using SVN:
* Don't use keywords at all (bad, I like, use and need them)
* Create a branch, remove all "svn:keywords" properties from the branch 
and then export the branch (better, but sort of unelegant).

Is there a better way to do this which I havn't found yet (I'm quite new 
to Subversion) ?


Thanks,

Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Checkout/Export without keyword substituion

Posted by Peter Strempel <zo...@web.de>.
Jeremy Pereira wrote:
> Since $Id$ is a CVS keyword too, won't CVS just replace the Subversion 
> specific expansion with its own expansion?  (Going the other way worked 
> fine when I migrated from CVS to SVN).

Yes, but keeping the $Id$ in files controlled by both CVS and SVN isn't 
the problem by itself.

What I do is:

cvs -p:someremoteserver co -kk myproject

(before) cvs -p:localserver export -r HEAD myproject -kk
(now)    svn export repos myproject

cp -a localcopy/myproject remotecopy/myproject
cvs -p:someremoteserver commit -m "Weekly synch"
[go to lunch, might be finished afterwards]

The whole setup is very ugly, but the remote server is so slow I simply 
cannot work with this, so I setup a local repos (CVS before, now SVN) 
and synch it with the remote CVS server once in a while. Certainly 
anyone with a reasonable infrastructure doesn't need to do such a nonsense.

But now when I copy the svn export over the CVS working dir, all files 
are marked as modified just because the $Id$ line changed. This makes it 
very difficult to merge changes done by other developers. Before when I 
used a local CVS, I checked out and exported with -kk, so after the 
recursive copy only the real modified files were marked as modified and 
it was easy to spot the changes.

The optimal solution for me would be something like:
svn export --pleasedontreplacekeywords repos myproject

The previously suggested solution by Patrick sounds interesting, I will 
give it a try.


Thanks,

Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Checkout/Export without keyword substituion

Posted by Jeremy Pereira <je...@ntlworld.com>.
Since $Id$ is a CVS keyword too, won't CVS just replace the Subversion 
specific expansion with its own expansion?  (Going the other way worked 
fine when I migrated from CVS to SVN).

On Sep 25, 2004, at 16:12, Peter Strempel wrote:

> Hello,
>
> is there a way to suppress keyword substituion during checkout or 
> export, like the CVS -kk switch?
>
> I have a lot of files with the $Id$ keyword in the header. Those files 
> have the "svn:keywords Id" property set. So when I checkout, the $Id$ 
> keyword is replaced. Fine, that's how it's supposed to work.
>
> However, occasionally I need to do an export without the keyword 
> replacement (I need this to synch the whole code with a remote CVS 
> server). With CVS I'd just do "cvs export -r HEAD myproject -kk", and 
> the $Id$ stays $Id$.
>
> I currently see two approaches for this using SVN:
> * Don't use keywords at all (bad, I like, use and need them)
> * Create a branch, remove all "svn:keywords" properties from the 
> branch and then export the branch (better, but sort of unelegant).
>
> Is there a better way to do this which I havn't found yet (I'm quite 
> new to Subversion) ?
>
>
> Thanks,
>
> Peter
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
>
>
--
Jeremy Pereira
http://www.jeremyp.net


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Checkout/Export without keyword substituion

Posted by Patrick Smears <pa...@ensoft.co.uk>.
On Sat, 25 Sep 2004, Peter Strempel wrote:

> Hello,
> 
> is there a way to suppress keyword substituion during checkout or 
> export, like the CVS -kk switch?
> 
> I have a lot of files with the $Id$ keyword in the header. Those files 
> have the "svn:keywords Id" property set. So when I checkout, the $Id$ 
> keyword is replaced. Fine, that's how it's supposed to work.
> 
> However, occasionally I need to do an export without the keyword 
> replacement (I need this to synch the whole code with a remote CVS 
> server). With CVS I'd just do "cvs export -r HEAD myproject -kk", and 
> the $Id$ stays $Id$.
> 
> I currently see two approaches for this using SVN:
> * Don't use keywords at all (bad, I like, use and need them)
> * Create a branch, remove all "svn:keywords" properties from the branch 
> and then export the branch (better, but sort of unelegant).
> 
> Is there a better way to do this which I havn't found yet (I'm quite new 
> to Subversion) ?

I don't think there's currently a way to do that with a command-line
option (though such an option would probably be useful). The following
recipe appears to work (at least in my little test repository) - it's
neither elegant nor especially fast, but it does save on creating a
branch:

# Check out a working copy
svn co $REPOS wc

# Remove the 'keywords' property from all files in the WC
svn propdel -R svn:keywords wc

# Delete all non-subversion files
find wc -path "*/.svn" -prune -o -type f -print0 | xargs -0 rm

# Bring back the files (without keywords)
svn update wc

Hope this helps,

Patrick


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org