Login | Register
My pages Projects Community openCollabNet

Discussions > commits > svn commit: r2427 - branches/fsvs-1.2.x/fsvs: . src src/dox

fsvs
Discussion topic

Back to topic list

svn commit: r2427 - branches/fsvs-1.2.x/fsvs: . src src/dox

Author tekknokrat
Full name Gunnar Thielebein
Date 2010-02-13 03:49:16 PST
Message Author: tekknokrat
Date: 2010-02-13 03:49:16-0800
New Revision: 2427

Modified:
   branches/fsvs-1.2.x/fsvs/ (props changed)
   branches/fsvs-1.2.x/​fsvs/src/dox/options​.dox
   branches/fsvs-1.2.x/​fsvs/src/helper.c
   branches/fsvs-1.2.x/​fsvs/src/helper.h
   branches/fsvs-1.2.x/​fsvs/src/options.c
   branches/fsvs-1.2.x/​fsvs/src/options.h
   branches/fsvs-1.2.x/​fsvs/src/status.c

Log:
Introduce feature dir_exclude_mtime

Modified: branches/fsvs-1.2.x/​fsvs/src/dox/options​.dox
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/branches/fsvs-1.2.​x/fsvs/src/dox/optio​ns.dox?view=diff​&pathrev=2427&r1​=2426&r2=2427
====================​====================​====================​==================
--- branches/fsvs-1.2.x/​fsvs/src/dox/options​.dox (original)
+++ branches/fsvs-1.2.x/​fsvs/src/dox/options​.dox 2010-02-13 03:49:16-0800
@@ -49,6 +49,7 @@
 <LI>\c dir_sort - \ref o_dir_sort
 <LI>\c empty_commit - \ref o_empty_commit
 <LI>\c empty_message - \ref o_empty_msg
+<LI>\c dir_exclude_mtime - \ref o_dir_exclude_mtime
 <LI>\c filter - \ref o_filter, but see \ref glob_opt_filter "-f".
 <LI>\c group_stats - \ref o_group_stats.
 <LI>\c limit - \ref o_logmax
@@ -133,6 +134,10 @@
 \note If FSVS aborts with an error during \ref status output, you might
 want to turn this option off again, to see where FSVS stops; the easiest
 way is on the command line with \c -odir_sort=no.
+\subsection o_dir_exclude_mtime Ignore mtime-metadata changes for folders.
+When this option is enabled, folders where only the mtime changed are excluded for status checks.
+This is helpful in situations where the metadata of a folder was changed due to temporarily
+created files. E.g. vi(m) create such files.
 
 
 \subsection o_filter Filtering entries

Modified: branches/fsvs-1.2.x/​fsvs/src/helper.c
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/branches/fsvs-1.2.​x/fsvs/src/helper.c?​view=diff&pathre​v=2427&r1=2426​&r2=2427
====================​====================​====================​==================
--- branches/fsvs-1.2.x/​fsvs/src/helper.c (original)
+++ branches/fsvs-1.2.x/​fsvs/src/helper.c 2010-02-13 03:49:16-0800
@@ -2101,4 +2101,14 @@
     return strcoll(*c,*d);
 }
 
+int hlp__dir_mtime_changed(struct estat *sts) {
+ int e_stat, r_stat;
+
+ e_stat = sts->entry_status;
+ r_stat = sts->remote_status;
+
+ return ( opt__get_int(OPT__DI​R_EXCLUDE_MTIME) && S_ISDIR(sts->st.mode) && (e_stat & FS_META_MTIME)
+ && (~e_stat & FS_META_OWNER) && (~e_stat & FS_META_GROUP) && (~e_stat & FS_META_UMODE));
+}
+
 

Modified: branches/fsvs-1.2.x/​fsvs/src/helper.h
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/branches/fsvs-1.2.​x/fsvs/src/helper.h?​view=diff&pathre​v=2427&r1=2426​&r2=2427
====================​====================​====================​==================
--- branches/fsvs-1.2.x/​fsvs/src/helper.h (original)
+++ branches/fsvs-1.2.x/​fsvs/src/helper.h 2010-02-13 03:49:16-0800
@@ -232,4 +232,6 @@
 
 int hlp__compare_string_​pointers(const void *a, const void *b);
 
+int hlp__dir_mtime_changed(struct estat *sts);
+
 #endif

Modified: branches/fsvs-1.2.x/​fsvs/src/options.c
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/branches/fsvs-1.2.​x/fsvs/src/options.c​?view=diff&pathr​ev=2427&r1=2426​&r2=2427
====================​====================​====================​==================
--- branches/fsvs-1.2.x/​fsvs/src/options.c (original)
+++ branches/fsvs-1.2.x/​fsvs/src/options.c 2010-02-13 03:49:16-0800
@@ -217,6 +217,10 @@
         .name="stop_change", .i_val=OPT__NO,
         .parse=opt___string2val, .parm=opt___yes_no,
     },
+ [OPT__DIR_EXCLUDE_MTIME] = {
+ .name="dir_exclude_mtime", .i_val=OPT__NO,
+ .parse=opt___string2val, .parm=opt___yes_no,
+ },
     [OPT__FILTER] = {
         .name="filter", .i_val=0,
         .parse=opt___strings2bitmap, .parm=opt___filter_strings,

Modified: branches/fsvs-1.2.x/​fsvs/src/options.h
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/branches/fsvs-1.2.​x/fsvs/src/options.h​?view=diff&pathr​ev=2427&r1=2426​&r2=2427
====================​====================​====================​==================
--- branches/fsvs-1.2.x/​fsvs/src/options.h (original)
+++ branches/fsvs-1.2.x/​fsvs/src/options.h 2010-02-13 03:49:16-0800
@@ -45,6 +45,8 @@
     /** Stop on change.
      * See \ref o_stop_change*/
     OPT__STOP_ON_CHANGE,
+ /** Exclude directories where only the mtime metadata changed, see \ref o_dir_exclude_mtime. */
+ OPT__DIR_EXCLUDE_MTIME,
     /** The filter mask as given with \ref o_filter "-f". */
     OPT__FILTER,
     /** Whichs change checks to perform, \ref o_chcheck. */
@@ -172,7 +174,7 @@
  * */
 struct opt__list_t {
     /** Name of the option. */
- char name[16];
+ char *name;
 
     /** Function to convert the string into a value. */
     opt___parse_t *parse;

Modified: branches/fsvs-1.2.x/​fsvs/src/status.c
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/branches/fsvs-1.2.​x/fsvs/src/status.c?​view=diff&pathre​v=2427&r1=2426​&r2=2427
====================​====================​====================​==================
--- branches/fsvs-1.2.x/​fsvs/src/status.c (original)
+++ branches/fsvs-1.2.x/​fsvs/src/status.c 2010-02-13 03:49:16-0800
@@ -346,11 +346,18 @@
 {
     int status;
 
- if (opt__get_int(OPT__S​TOP_ON_CHANGE) &&
- sts->entry_status)
+ status = 0;
+
+ /*
+ * @todo: this still exit(1) for excluded dir, why?
+ */
+ if ( opt__get_int(OPT__ST​OP_ON_CHANGE) && sts->entry_status && (~hlp__dir_mtime_changed(sts)) )
         /* Status is a read-only operation, so that works. */
         exit(1);
 
+ if( hlp__dir_mtime_changed(sts))
+ return status;
+
     STOPIF( st__status(sts), NULL);
 
 ex:

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

svn commit: r2427 - branches/fsvs-1.2.x/fsvs: . src src/dox tekknokrat Gunnar Thielebein 2010-02-13 03:49:16 PST
Messages per page: