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

Re: saving time stamps of files

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2003-05-16 21:13:39 CEST

"P.Marek" <pmarek@cpan.org> writes:

> This just saves the mtime of the files in a new property, so this patch is
> trivial.
[...]
> diff -urN subversion-0.22.0_origin/subversion/libsvn_wc/adm_ops.c subversion-0.22.0/subversion/libsvn_wc/adm_ops.c
> --- subversion-0.22.0_origin/subversion/libsvn_wc/adm_ops.c Thu May 8 05:03:37 2003
> +++ subversion-0.22.0/subversion/libsvn_wc/adm_ops.c Fri May 16 12:41:36 2003
> @@ -41,6 +41,7 @@
> #include "svn_io.h"
> #include "svn_md5.h"
> #include "svn_xml.h"
> +#include "svn_time.h"
>
> #include "wc.h"
> #include "log.h"
> @@ -965,8 +966,9 @@
> if (kind == svn_node_file)
> {
> /* If this is a new file being added instead of a file copy,
> - then try to detect the mime-type of this file and set
> - svn:executable if the file is executable. Otherwise, use the
> + then try to detect the mime-type of this file, set
> + svn:executable if the file is executable, and
> + save the mtime. Otherwise, use the
> values in the original file. */
> if (! copyfrom_url)
> {
> @@ -990,6 +992,20 @@
> SVN_ERR (svn_wc_prop_set (SVN_PROP_EXECUTABLE, &emptystr, path,
> parent_access, pool));
> }
> +
> + /* set svn:text-time from the current mtime */
> + {
> + svn_string_t time_str;
> + apr_time_t tstamp;
> +
> + SVN_ERR (svn_io_file_affected_time (&tstamp, path, pool));
> + time_str.data = svn_time_to_cstring (tstamp, pool);
> +
> + time_str.len = strlen(time_str.data);
> + SVN_ERR (svn_wc_prop_set (SVN_PROP_TEXT_TIME, &time_str, path,
> + parent_access, pool));
> + }
> +

This saves the file's mtime when an 'svn add' command is run, but I
can't see any point in doing this. A complete system for storing
mtime is going to need to retrieve and store it when 'svn commit' is
run, and once it is getting done at 'svn commit' it is pointless to do
it at 'svn add'.

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri May 16 21:15:02 2003

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

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