Login | Register
My pages Projects Community openCollabNet

Discussions > commits > svn commit: r1561 - trunk: . fsvs/src

fsvs
Discussion topic

Back to topic list

svn commit: r1561 - trunk: . fsvs/src

Author pmarek
Full name P.Marek
Date 2008-03-24 23:20:12 PDT
Message Author: pmarek
Date: 2008-03-24 23:20:11-0700
New Revision: 1561

Modified:
   trunk/ (props changed)
   trunk/fsvs/src/actions.c
   trunk/fsvs/src/actions.h
   trunk/fsvs/src/add_unvers.c
   trunk/fsvs/src/commit.c
   trunk/fsvs/src/cp_mv.c
   trunk/fsvs/src/info.c
   trunk/fsvs/src/racallback.c
   trunk/fsvs/src/resolve.c
   trunk/fsvs/src/revert.c
   trunk/fsvs/src/status.c
   trunk/fsvs/src/sync.c
   trunk/fsvs/src/update.c
   trunk/fsvs/src/waa.c

Log:
Removed the path argument to action callbacks. Was NULL more often than not.


Modified: trunk/fsvs/src/actions.c
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/src/act​ions.c?view=diff​&rev=1561&p1=tru​nk/fsvs/src/actions.​c&p2=trunk/fsvs/​src/actions.c&r1​=1560&r2=1561
====================​====================​====================​==================
--- trunk/fsvs/src/actions.c (original)
+++ trunk/fsvs/src/actions.c 2008-03-24 23:20:11-0700
@@ -24,19 +24,13 @@
 /** This wrapper-callback for the current action callback calculates the \a
  * path and fills in the \c entry_type for the current \a sts, if
  * necessary. */
-int ac__dispatch(struct estat *sts, char *path)
+int ac__dispatch(struct estat *sts)
 {
     int status;
 
     status=0;
     if (!action->local_callback) goto ex;
 
- if (!path)
- {
- status=ops__build_pa​th(&path, sts);
- if (status) return status;
- }
-
     /* remove all variables */
     switch (sts->entry_type)
     {
@@ -51,10 +45,10 @@
     if (opt__get_int(OPT__FILTER) == FILTER__ALL ||
             /* or it's an interesting entry. */
             (sts->entry_status & opt__get_int(OPT__FILTER)))
- STOPIF( action->local_callback(sts, path), NULL);
+ STOPIF( action->local_callback(sts), NULL);
     else
     {
- DEBUGP("%s is not the entry you're looking for", path);
+ DEBUGP("%s is not the entry you're looking for", sts->name);
         /* We have to keep the removed flag for directories, so that children
          * know that they don't exist anymore. */
         if (S_ISDIR(sts->st.mode) && (sts->entry_status & FS_REMOVED))

Modified: trunk/fsvs/src/actions.h
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/src/act​ions.h?view=diff​&rev=1561&p1=tru​nk/fsvs/src/actions.​h&p2=trunk/fsvs/​src/actions.h&r1​=1560&r2=1561
====================​====================​====================​==================
--- trunk/fsvs/src/actions.h (original)
+++ trunk/fsvs/src/actions.h 2008-03-24 23:20:11-0700
@@ -17,8 +17,10 @@
 
 /** \name Action callbacks. */
 /** @{ */
-/** One to show progress */
-typedef int (action_t)(struct estat *sts, char *path);
+/** One to show progress.
+ * The full (wc-based) path can be built as required by \ref
+ * ops__build_path().*/
+typedef int (action_t)(struct estat *sts);
 /** One for working */
 typedef int (work_t)(struct estat *root, int argc, char *argv[]);
 /** One after all progress has been made. */

Modified: trunk/fsvs/src/add_unvers.c
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/src/add​_unvers.c?view=diff​&rev=1561&p1=​trunk/fsvs/src/add_u​nvers.c&p2=trunk​/fsvs/src/add_unvers​.c&r1=1560&r​2=1561
====================​====================​====================​==================
--- trunk/fsvs/src/add_unvers.c (original)
+++ trunk/fsvs/src/add_unvers.c 2008-03-24 23:20:11-0700
@@ -141,7 +141,7 @@
  * */
 
 
-int au__action(struct estat *sts, char *path)
+int au__action(struct estat *sts)
 {
     int status;
     int old;
@@ -161,7 +161,7 @@
      * afterwards. */
     sts->flags = (sts->flags & ~mask) | action->i_val;
     DEBUGP("changing flags: has now %X", sts->flags);
- STOPIF( st__status(sts, NULL), NULL);
+ STOPIF( st__status(sts), NULL);
 
     /* If we have an entry which was added *and* unversioned (or vice
      * versa), but

Modified: trunk/fsvs/src/commit.c
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/src/com​mit.c?view=diff&​rev=1561&p1=trun​k/fsvs/src/commit.c​&p2=trunk/fsvs/sr​c/commit.c&r1=15​60&r2=1561
====================​====================​====================​==================
--- trunk/fsvs/src/commit.c (original)
+++ trunk/fsvs/src/commit.c 2008-03-24 23:20:11-0700
@@ -163,12 +163,14 @@
 /** -.
  *
  * This callback is called by input_tree and build_tree. */
-int ci__action(struct estat *sts,
- char *path)
+int ci__action(struct estat *sts)
 {
     int status;
+ char *path;
 
 
+ STOPIF( ops__build_path(&path, sts), NULL);
+
     STOPIF_CODE_ERR( sts->flags & RF_CONFLICT, EBUSY,
             "!The entry \"%s\" is still marked as conflict.", path);
 
@@ -185,7 +187,7 @@
         }
     }
 
- STOPIF( st__progress(sts, path), NULL);
+ STOPIF( st__progress(sts), NULL);
 
 ex:
     return status;
@@ -610,7 +612,7 @@
         /* as the path needs to be canonical we strip the ./ in front */
         STOPIF( hlp__local2utf8(filename+2, &utf8_filename, -1), NULL );
 
- STOPIF( st__status(sts, filename), NULL);
+ STOPIF( st__status(sts), NULL);
 
         DEBUGP("%s: action is %X, type is %X, flags %X",
                 filename, sts->entry_status, sts->entry_type, sts->flags);

Modified: trunk/fsvs/src/cp_mv.c
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/src/cp_​mv.c?view=diff&r​ev=1561&p1=trunk​/fsvs/src/cp_mv.c​&p2=trunk/fsvs/src/​cp_mv.c&r1=1560​&r2=1561
====================​====================​====================​==================
--- trunk/fsvs/src/cp_mv.c (original)
+++ trunk/fsvs/src/cp_mv.c 2008-03-24 23:20:11-0700
@@ -649,7 +649,7 @@
 
 
 /** Inserts the given entry in all allowed matching databases. */
-int cm___register_entry(struct estat *sts, char *path)
+int cm___register_entry(struct estat *sts)
 {
     int status;
     int i;

Modified: trunk/fsvs/src/info.c
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/src/inf​o.c?view=diff&re​v=1561&p1=trunk/​fsvs/src/info.c&​p2=trunk/fsvs/src/in​fo.c&r1=1560​&r2=1561
====================​====================​====================​==================
--- trunk/fsvs/src/info.c (original)
+++ trunk/fsvs/src/info.c 2008-03-24 23:20:11-0700
@@ -65,16 +65,15 @@
 
 /** Utility function - prints the normal status and the extended
  * information. */
-int info__action(struct estat *sts, char *path)
+int info__action(struct estat *sts)
 {
     int status;
 
- DEBUGP("%s was printed: %d", path, sts->was_output);
     /* Always print this entry. */
     sts->was_output=0;
     sts->flags |= RF_PRINT;
 
- STOPIF( st__status(sts, path), NULL);
+ STOPIF( st__status(sts), NULL);
     STOPIF( st__print_entry_info(sts, 1), NULL);
 
 ex:

Modified: trunk/fsvs/src/racallback.c
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/src/rac​allback.c?view=diff​&rev=1561&p1=​trunk/fsvs/src/racal​lback.c&p2=trunk​/fsvs/src/racallback​.c&r1=1560&r​2=1561
====================​====================​====================​==================
--- trunk/fsvs/src/racallback.c (original)
+++ trunk/fsvs/src/racallback.c 2008-03-24 23:20:11-0700
@@ -304,7 +304,7 @@
         sts->remote_status = FS_REMOVED;
 
         if (action->repos_feedback)
- STOPIF( action->repos_feedback(sts, NULL), NULL);
+ STOPIF( action->repos_feedback(sts), NULL);
 
         /** Allow lower priority entries to be seen.
          * A bit of a hack.
@@ -412,7 +412,7 @@
     sts->repos_rev = cb___dest_rev;
 
     if (action->repos_feedback)
- STOPIF( action->repos_feedback(sts, NULL), NULL);
+ STOPIF( action->repos_feedback(sts), NULL);
 
 ex:
     return status;

Modified: trunk/fsvs/src/resolve.c
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/src/res​olve.c?view=diff​&rev=1561&p1=tru​nk/fsvs/src/resolve.​c&p2=trunk/fsvs/​src/resolve.c&r1​=1560&r2=1561
====================​====================​====================​==================
--- trunk/fsvs/src/resolve.c (original)
+++ trunk/fsvs/src/resolve.c 2008-03-24 23:20:11-0700
@@ -95,7 +95,7 @@
 
 /** -.
  * */
-int res__action(struct estat *sts, char *path)
+int res__action(struct estat *sts)
 {
     int status;
 
@@ -110,7 +110,7 @@
     {
         if ( sts->flags & RF_CONFLICT )
             STOPIF( res__remove_aux_files(sts), NULL);
- STOPIF( st__status(sts, path), NULL);
+ STOPIF( st__status(sts), NULL);
     }
 
 ex:

Modified: trunk/fsvs/src/revert.c
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/src/rev​ert.c?view=diff&​rev=1561&p1=trun​k/fsvs/src/revert.c​&p2=trunk/fsvs/sr​c/revert.c&r1=15​60&r2=1561
====================​====================​====================​==================
--- trunk/fsvs/src/revert.c (original)
+++ trunk/fsvs/src/revert.c 2008-03-24 23:20:11-0700
@@ -557,16 +557,17 @@
  * @a session from within the editing operations of @a update_editor.
  * \endcode
  * */
-int rev__action(struct estat *sts, char *path)
+int rev__action(struct estat *sts)
 {
     int status;
     svn_revnum_t fetched, wanted;
     struct estat copy;
     char *url_to_fetch;
+ char *path;
 
 
     status=0;
- DEBUGP("got %s", path);
+ STOPIF( ops__build_path(&path, sts), NULL);
 
     /* Garbage collection for entries that should be ignored happens in
      * waa__output_tree(); changing the tree while it's being traversed is
@@ -730,7 +731,7 @@
      * the "old" revision. */
     sts->flags |= RF_PRINT;
 
- STOPIF( st__status(sts, path), NULL);
+ STOPIF( st__status(sts), NULL);
 
 
     /* Entries that are now ignored don't matter for the parent directory;
@@ -924,7 +925,7 @@
                 else
                 {
                     /* We must do that here ... later the entry is no longer valid. */
- STOPIF( st__rm_status(sts, NULL), NULL);
+ STOPIF( st__rm_status(sts), NULL);
                     STOPIF( ops__delete_entry(dir, NULL, i, UNKNOWN_INDEX), NULL);
                     i--;
                     goto loop_end;
@@ -1069,7 +1070,7 @@
 
         /* After the recursive call the path string may not be valid anymore.
          * */
- STOPIF( st__rm_status(sts, NULL), NULL);
+ STOPIF( st__rm_status(sts), NULL);
 
 loop_end:
         apr_pool_destroy(subpool);
@@ -1080,7 +1081,7 @@
 
     /* The root entry would not be printed; do that here. */
     if (!dir->parent)
- STOPIF( st__rm_status(dir, NULL), NULL);
+ STOPIF( st__rm_status(dir), NULL);
 
     /* If the directory had local modifications, we need to check it
      * next time -- as we take its current timestamp,

Modified: trunk/fsvs/src/status.c
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/src/sta​tus.c?view=diff&​rev=1561&p1=trun​k/fsvs/src/status.c​&p2=trunk/fsvs/sr​c/status.c&r1=15​60&r2=1561
====================​====================​====================​==================
--- trunk/fsvs/src/status.c (original)
+++ trunk/fsvs/src/status.c 2008-03-24 23:20:11-0700
@@ -259,14 +259,15 @@
 
 /** -.
  * */
-int st__status(struct estat *sts, char *path)
+int st__status(struct estat *sts)
 {
   int status;
     int e_stat, flags;
+ char *path;
 
 
   status=0;
- if (!path) STOPIF( ops__build_path(&path, sts), NULL);
+ STOPIF( ops__build_path(&path, sts), NULL);
 
   /* Is this entry already done? */
   if (sts->was_output)
@@ -301,13 +302,14 @@
 
 /** -.
  * */
-int st__rm_status(struct estat *sts, char *path)
+int st__rm_status(struct estat *sts)
 {
     int status;
+ char *path;
 
 
     status=0;
- if (!path) STOPIF( ops__build_path(&path, sts), NULL);
+ STOPIF( ops__build_path(&path, sts), NULL);
 
     STOPIF( st__print_status(path,
                 sts->remote_status, 0,
@@ -368,7 +370,7 @@
  *
  * Commit and update themselves print the information send to/received from
  * the repository. */
-int st__progress(struct estat *sts, char *path)
+int st__progress(struct estat *sts)
 {
     static unsigned int counter=0;
     static int is_tty=0;

Modified: trunk/fsvs/src/sync.c
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/src/syn​c.c?view=diff&re​v=1561&p1=trunk/​fsvs/src/sync.c&​p2=trunk/fsvs/src/sy​nc.c&r1=1560​&r2=1561
====================​====================​====================​==================
--- trunk/fsvs/src/sync.c (original)
+++ trunk/fsvs/src/sync.c 2008-03-24 23:20:11-0700
@@ -91,16 +91,17 @@
 #include "helper.h"
 
 
-int sync__progress(struct estat *sts, char *path)
+int sync__progress(struct estat *sts)
 {
     int status;
     struct sstat_t st;
+ char *path;
 
 
     status=0;
- if (!path) STOPIF( ops__build_path(&path, sts), NULL);
+ STOPIF( ops__build_path(&path, sts), NULL);
 
- STOPIF( st__rm_status(sts, path), NULL);
+ STOPIF( st__rm_status(sts), NULL);
 
     /* If the entry is a special node (symlink or device), we have
      * a little problem here.

Modified: trunk/fsvs/src/update.c
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/src/upd​ate.c?view=diff&​rev=1561&p1=trun​k/fsvs/src/update.c​&p2=trunk/fsvs/sr​c/update.c&r1=15​60&r2=1561
====================​====================​====================​==================
--- trunk/fsvs/src/update.c (original)
+++ trunk/fsvs/src/update.c 2008-03-24 23:20:11-0700
@@ -743,7 +743,7 @@
 
     change=sts->entry_status;
     sts->remote_statu​s=FS_REMOVED;
- STOPIF( st__rm_status(sts, filename), NULL);
+ STOPIF( st__rm_status(sts), NULL);
 
     if (!action->is_compare)
     {
@@ -873,7 +873,7 @@
     STOPIF( hlp__lstat( filename, &(sts->st)),
             "Cannot lstat('%s')", filename);
     /* finished, report to user */
- STOPIF( st__status(sts, filename), NULL);
+ STOPIF( st__status(sts), NULL);
 
     /* Mark this directory for being checked next time. */
     sts->flags |= RF_CHECK;
@@ -1185,7 +1185,7 @@
     }
 
     /* finished, report to user */
- STOPIF( st__status(sts, filename), NULL);
+ STOPIF( st__status(sts), NULL);
 
 ex:
     RETURN_SVNERR(status);

Modified: trunk/fsvs/src/waa.c
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/src/waa​.c?view=diff&rev​=1561&p1=trunk/f​svs/src/waa.c&p2​=trunk/fsvs/src/waa.​c&r1=1560&r2​=1561
====================​====================​====================​==================
--- trunk/fsvs/src/waa.c (original)
+++ trunk/fsvs/src/waa.c 2008-03-24 23:20:11-0700
@@ -859,7 +859,7 @@
             sts->entry_type=o​ps___filetype(&(​sts->st));
         }
 
- STOPIF( ac__dispatch(sts, NULL), NULL);
+ STOPIF( ac__dispatch(sts), NULL);
     }
 
     if (have_ignored)
@@ -1381,7 +1381,7 @@
 
             DEBUGP("found a new one!");
             sts->entry_status=FS_NEW;
- STOPIF( ac__dispatch(sts, NULL), NULL);
+ STOPIF( ac__dispatch(sts), NULL);
             approx_entry_count++;
 
             STOPIF( ops__set_to_handle_bits(sts), NULL);
@@ -1675,7 +1675,7 @@
         }
 
         if (callback)
- STOPIF( callback(sts, NULL), NULL);
+ STOPIF( callback(sts), NULL);
     } /* while (count) read entries */
 
 
@@ -1743,7 +1743,7 @@
     /* Whether to do something with this directory or not shall not be
      * decided here. Just pass it on. */
     /* The path may not be valid here anymore. */
- STOPIF( ac__dispatch(sts, NULL), NULL);
+ STOPIF( ac__dispatch(sts), NULL);
 
     return status;
 }
@@ -1881,7 +1881,7 @@
         if (sts->do_this_entry &&
                 ( !S_ISDIR(sts->st.mode) ||
                     (sts->entry_status & FS_REMOVED)) )
- STOPIF( ac__dispatch(sts, NULL), NULL);
+ STOPIF( ac__dispatch(sts), NULL);
 
 
         /* The parent must be done *after* the last child node ... at least that's
@@ -2469,7 +2469,7 @@
     while ( (sts=*list) )
     {
         if (sts->do_this_entry)
- STOPIF( handler(sts, NULL), NULL);
+ STOPIF( handler(sts), NULL);
 
         if (sts->do_tree && sts->entry_type==FT_DIR)
             STOPIF( waa__do_sorted_tree(sts, handler), NULL);

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

Messages

Show all messages in topic

svn commit: r1561 - trunk: . fsvs/src pmarek P.Marek 2008-03-24 23:20:12 PDT
Messages per page: