문제

I'm using RapidSVN as svn client and to set the svn:keywords I have to go to each file, right-click > Properties > New > Name = svn:keywords > Value = Id > OK

This is not a problem yet because the project doesn't have a lot of files, but I can't get this to work properly. When I commit a new version to my GoogleCode repository my local files change the Id value but it doesn't happen in the remote GoogleCode repository. When I see the remote file's content, the Id is unchanged.

Can anyone tell me why?

도움이 되었습니까?

해결책

You'll have to explain exactly how you're doing this.

Unlike other RCS and possibly CVS, Subversion doesn't automatically expand Keywords. There are two parts to using keywords:

  1. Setting the svn:keywords property in the file to the keywords you want to expand. These are limited to:
    • URL
    • Author
    • Date
    • Id
    • Revision
  2. Putting the Keyword inside your file surrounded by dollar signs.

Like this:

$Author$

This will expand to:

$Author: dweintaub$

Are you doing all of that?

The whole idea of keyword expansion is now considered an out of date concept that wasn't really all that good an idea. As long as your code is in Subversion, you can get all of this (and more) without doing Keyword expansion.

A lot of time, this was used to see what versions of the software was used in compilation. However, if you're compiling code, there are simply better ways of embedding in the revision data. For example, you probably are using a build system that creates build numbers. A better thing to do is to simply embed the build number in a single file as its compiled, so you can view it in an About Box.

So, if you really can't get this to work, it isn't all that bad. It's saving you from a practice that is no longer considered a good idea for CM.

다른 팁

When I commit a new version to my GoogleCode repository my local files change the Id value but it doesn't happen in the remote GoogleCode repository

Just don't worry and forget, if on client side you get expected result: expanded keyword. Some server-side repo-browsers use "fair" methods for accessing data (as svn-client), some - not. Because SVN-keywords are expanded only in client, not in repository-data directly, you can see keywords instead of real-data in server view, but it's meaningless: compare output of (top 3 lines) of File inside Repo-Browser and real output to any user

svn cat https://subversion.assembla.com/svn/customlocations-greylink/trunk/Local/Local.ini
// $Revision: 991 $
// $Date: 2010-08-18 21:22:02 +0600 (╨б╤А, 18 ╨░╨▓╨│ 2010) $
// $Author: Infinity_Love $
...
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top