[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn propset keywords Date

From: Ryan Schmidt <subversion-2010a_at_ryandesign.com>
Date: Sun, 24 Jan 2010 16:26:03 -0600

On Jan 24, 2010, at 07:54, Johan Hogdahl wrote:

> Hello.
> I'm new to subversion after using CVS and RCS for a long time.
> I have just done a conversion of our code base to subversion.
> Now i got into a problem, the propset keywords Date fills in the Date in a complete other way then
> CVS did. And cause many of our development machines is configured with Swedish language,
> some days of week will get Swedish (iso-8859-1) chars, which can not be handled by some compilers. Is there any way to use propset without the part in (..), Its a very useless part anyway.
> Is there any configuration file, command or such, to change the format.

The only way I know to influence the way the Date keyword expands is to set the LANG (or LC_ALL or LC_TIME) environment variable to the locale you want to use for the date format, at the time the keyword is expanded by the client (i.e. at the time you issue the "svn ci" or "svn up" command). Setting LANG or LC_ALL will influence all localizable settings, including informational and error messages; if you don't want to change the locale of those, set just LC_TIME to affect just date and time formats. You could pick a locale name like "en_US.UTF-8" (or whatever it's called on your system) or just use the "C" locale which pretty assuredly won't contain any weird characters that will confuse your compiler. Example from my Mac OS X system:

$ LANG=sv_SE.UTF-8
$ svnadmin create repo
$ svn co file://`pwd`/repo wc
Checkade ut revision 0.
$ cd wc
$ echo '$Date$' > file
$ svn add file
A file
$ svn propset svn:keywords Date file
satte egenskapen "svn:keywords" på "file"
$ svn ci -m "x"
Lägger till file
Skickar filinnehåll .
Arkiverade revision 1.
$ cat file
$Date: 2010-01-24 16:21:02 -0600 (Sön, 24 Jan 2010) $
$ rm file
$ LC_TIME=C svn up
Återskapade "file"
Är på revision 1.
$ cat file
$Date: 2010-01-24 16:21:02 -0600 (Sun, 24 Jan 2010) $
$ rm file
$ LANG=C svn up
Restored 'file'
At revision 1.
$ cat file
$Date: 2010-01-24 16:21:02 -0600 (Sun, 24 Jan 2010) $
$
Received on 2010-01-24 23:26:50 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.