简体   繁体   中英

Setting Date format for autoprop 'DATE' in SVN

I have some files that use the autoproperty $Date of SVN.

When some colleagues in France do a checkout of the repository, the date is in French. When they do the verification of checksum, these files are KO because of this difference of format for the date.

Note: we are using Windows and our client of choice is TortoiseSVN but are open to use command line clients.

Question 1 : Is there any way to force the format for the date during the checkout?

We tried the following:

  • Setting "English" in Tortoise SVN
  • Setting environment variable LANG to EN_US and doing a checkout with both TortoiseSVN and svn commandline

None of these solutions is working.

Question 2 : Would the time zone impact the date in the header as well?

Thanks


NB: This is the header of our source code, for what it matters.

/*==============================================================================================
 *  FILENAME          : Source.h
 *  VERSION           : $Revision: 85911 $
 *  MODIFICATION DATE : $Date: 2015-06-12 18:26:22 +0800 (Fri, 12 Jun 2015) $
 *============================================================================================*/

A1 : I don't know, how to manipulate locale-setting in Windows in easy and automated style - inspired by this old answer in Subversion maillist - (better to ask it SU) and can suggest now only dirty hack: import reg-files for FR and EN locales before and after checkout (how to prepare: switch to FR in Control Panel, save Current Control Set part of registry, return to EN, save CCS again, leave in .reg only mutable part), checkout in bat-file only (change locale around checkout)

A2 : Sad, but yes

$Date: 2015-06-19 19:45:22 +0500 (Пт, 19 июн 2015) $

inserts not only language-specific date (trailing part), but also TZ of client

1.8.*-specific solution : you can create and use replacement for $Date keyword, which use UTC-time instead of local (as $Id do for time-part now) with %d variable it it

>svn pl -v file.txt
Properties on 'file.txt':
  svn:keywords
    Author Date Id Revision URL Header IntDate=%d

and IntDate will expand location-independent

$IntDate: 2015-06-19 14:45:22Z $

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM