Index: subversion/libsvn_subr/time.c =================================================================== --- subversion/libsvn_subr/time.c (revision 6) +++ subversion/libsvn_subr/time.c (working copy) @@ -27,6 +27,8 @@ #include "svn_utf.h" #include "svn_error.h" +#include "svn_config.h" +#include "svn_private_config.h" /*** Code. ***/ @@ -229,6 +231,11 @@ apr_size_t len, retlen; apr_status_t ret; char *datestr, *curptr, human_datestr[SVN_TIME__MAX_LENGTH]; + svn_error_t *err; + apr_hash_t *config; + svn_config_t *cfg; + const char *val; + char *human_timestamp_format_suffix_val; /* Get the time into parts */ apr_time_exp_lt (&exploded_time, when); @@ -256,11 +263,46 @@ /* Calculate offset to the end of the machine parseable part. */ curptr = datestr + len; + /* get SVN_CONFIG_OPTION_HUMAN_TIMESTAMP_FORMAT_SUFFIX option */ + /* Make room for human_timestamp_format_suffix_val */ + human_timestamp_format_suffix_val = apr_palloc (pool, SVN_TIME__MAX_LENGTH); + /* Make a default value for human_timestamp_format_suffix_val */ + apr_cpystrn(human_timestamp_format_suffix_val, + human_timestamp_format_suffix, + SVN_TIME__MAX_LENGTH); + /* Read human-timestamp-format-suffix option from config */ + err = svn_config_get_config (&config, NULL, pool); + if (!err) + { + cfg = config ? apr_hash_get (config, SVN_CONFIG_CATEGORY_CONFIG, + APR_HASH_KEY_STRING) : NULL; + if (cfg) + { + svn_config_get (cfg, &val, + SVN_CONFIG_SECTION_MISCELLANY, + SVN_CONFIG_OPTION_HUMAN_TIMESTAMP_FORMAT_SUFFIX, + NULL); + if (val) + { + if (val[0]) + { + /* Option is a nonempty string. + Append space to beginning of a string */ + apr_snprintf(human_timestamp_format_suffix_val, + SVN_TIME__MAX_LENGTH, " %s", val); + } + else + /* Option is an empty string. + Human explanatory part will be an empty string */ + *human_timestamp_format_suffix_val = '\0'; + } + } + } /* Put in human explanatory part */ ret = apr_strftime (human_datestr, &retlen, SVN_TIME__MAX_LENGTH - len, - human_timestamp_format_suffix, + human_timestamp_format_suffix_val, &exploded_time); /* If there was an error, ensure that the string is zero-terminated. */ @@ -269,7 +311,6 @@ else { const char *utf8_string; - svn_error_t *err; err = svn_utf_cstring_to_utf8 (&utf8_string, human_datestr, pool); if (err) Index: subversion/libsvn_subr/config_file.c =================================================================== --- subversion/libsvn_subr/config_file.c (revision 7) +++ subversion/libsvn_subr/config_file.c (working copy) @@ -1184,6 +1184,12 @@ APR_EOL_STR "# use-commit-times = yes" APR_EOL_STR + "### Set human-timestamp-format-suffix" + APR_EOL_STR + "### It can be an empty string." + APR_EOL_STR + "#human-timestamp-format-suffix=(%a, %d %b %Y)" + APR_EOL_STR "### Set no-unlock to prevent 'svn commit' from automatically" APR_EOL_STR "### releasing locks on files."