cvs-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Cvs-cvs] ccvs/src ChangeLog commit.c cvs.h import.c logm...


From: Derek Robert Price
Subject: [Cvs-cvs] ccvs/src ChangeLog commit.c cvs.h import.c logm...
Date: Tue, 28 Aug 2007 00:15:11 +0000

CVSROOT:        /cvsroot/cvs
Module name:    ccvs
Changes by:     Derek Robert Price <dprice>     07/08/28 00:15:10

Modified files:
        src            : ChangeLog commit.c cvs.h import.c logmsg.c 
                         logmsg.h parseinfo.c sanity.sh 

Log message:
        * commit.c (commit_fileproc): Move the do_editor & do_verify calls...
        (commit_direntproc): ...from these two locations...
        (check_filesdoneproc): ...to here.
        * cvs.h [LOGMSG_REREAD_NEVER, LOGMSG_REREAD_ALWAYS,
        LOGMSG_REREAD_STAT]: Move these definitions...
        (do_verify): ...and this prototype...
        * logmsg.h: ...to identically named entities here.
        * import.c (import): Check for errors returned by do_verify.
        * logmsg.c (do_verify): Return errors.
        * parseinfo.c: Include logmsg.h.
        * sanity.sh (info-v*): Compensate for changes.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/ChangeLog?cvsroot=cvs&r1=1.3526&r2=1.3527
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/commit.c?cvsroot=cvs&r1=1.273&r2=1.274
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/cvs.h?cvsroot=cvs&r1=1.352&r2=1.353
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/import.c?cvsroot=cvs&r1=1.183&r2=1.184
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/logmsg.c?cvsroot=cvs&r1=1.107&r2=1.108
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/logmsg.h?cvsroot=cvs&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/parseinfo.c?cvsroot=cvs&r1=1.89&r2=1.90
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/sanity.sh?cvsroot=cvs&r1=1.1185&r2=1.1186

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/ChangeLog,v
retrieving revision 1.3526
retrieving revision 1.3527
diff -u -b -r1.3526 -r1.3527
--- ChangeLog   27 Aug 2007 02:35:05 -0000      1.3526
+++ ChangeLog   28 Aug 2007 00:15:08 -0000      1.3527
@@ -1,3 +1,17 @@
+2007-08-27  Derek Price  <address@hidden>
+
+       * commit.c (commit_fileproc): Move the do_editor & do_verify calls...
+       (commit_direntproc): ...from these two locations...
+       (check_filesdoneproc): ...to here.
+       * cvs.h [LOGMSG_REREAD_NEVER, LOGMSG_REREAD_ALWAYS,
+       LOGMSG_REREAD_STAT]: Move these definitions...
+       (do_verify): ...and this prototype...
+       * logmsg.h: ...to identically named entities here.
+       * import.c (import): Check for errors returned by do_verify.
+       * logmsg.c (do_verify): Return errors.
+       * parseinfo.c: Include logmsg.h.
+       * sanity.sh (info-v*): Compensate for changes.
+
 2007-08-26  Derek Price  <address@hidden>
 
        * mkmodules.c (in_root): Rename to...

Index: commit.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/commit.c,v
retrieving revision 1.273
retrieving revision 1.274
diff -u -b -r1.273 -r1.274
--- commit.c    27 Aug 2007 02:11:05 -0000      1.273
+++ commit.c    28 Aug 2007 00:15:09 -0000      1.274
@@ -1379,6 +1379,18 @@
        err += n;
     }
 
+    /* Get the log message.
+     *
+     * This, and the call to do_verify() used to be run once in
+     * check_dirent_proc() and once in commit_fileproc, but putting it here
+     * covers both cases (recursion and files specified on the command line).
+     */
+    got_message = 1;
+    if (!server_active && use_editor)
+       do_editor (update_dir, &saved_message, repos, saved_ulist);
+
+    err += do_verify (&saved_message, repos, saved_ulist);
+
     return err;
 }
 
@@ -1428,20 +1440,6 @@
     ulist = ((struct master_lists *) p->data)->ulist;
     cilist = ((struct master_lists *) p->data)->cilist;
 
-    /*
-     * At this point, we should have the commit message unless we were called
-     * with files as args from the command line.  In that latter case, we
-     * need to get the commit message ourselves
-     */
-    if (!got_message)
-    {
-       got_message = 1;
-       if (!server_active && use_editor)
-           do_editor (finfo->update_dir, &saved_message,
-                      finfo->repository, ulist);
-       do_verify (&saved_message, finfo->repository, ulist);
-    }
-
     p = findnode (cilist, finfo->file);
     if (p == NULL)
        return 0;
@@ -1721,13 +1719,6 @@
     if (ulist == NULL || ulist->list->next == ulist->list)
        return R_SKIP_FILES;
 
-    /* get commit message */
-    got_message = 1;
-    real_repos = Name_Repository (dir, update_dir);
-    if (!server_active && use_editor)
-       do_editor (update_dir, &saved_message, real_repos, ulist);
-    do_verify (&saved_message, real_repos, ulist);
-    free (real_repos);
     return R_PROCESS;
 }
 

Index: cvs.h
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/cvs.h,v
retrieving revision 1.352
retrieving revision 1.353
diff -u -b -r1.352 -r1.353
--- cvs.h       22 Aug 2007 13:55:01 -0000      1.352
+++ cvs.h       28 Aug 2007 00:15:09 -0000      1.353
@@ -331,10 +331,6 @@
 
 
 
-#define LOGMSG_REREAD_NEVER 0  /* do_verify - never  reread message */
-#define LOGMSG_REREAD_ALWAYS 1 /* do_verify - always reread message */
-#define LOGMSG_REREAD_STAT 2   /* do_verify - reread message if changed */
-
 /* This header needs the LOGMSG_* defns above.  */
 #include "parseinfo.h"
 
@@ -493,8 +489,6 @@
 void do_editor (const char *dir, char **messagep,
                 const char *repository, List *changes);
 
-void do_verify (char **messagep, const char *repository, List *changes);
-
 typedef        int (*CALLBACKPROC)     (int argc, char *argv[], char *where,
        char *mwhere, char *mfile, int shorten, int local_specified,
        char *omodule, char *msg);

Index: import.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/import.c,v
retrieving revision 1.183
retrieving revision 1.184
diff -u -b -r1.183 -r1.184
--- import.c    25 Aug 2007 03:17:58 -0000      1.183
+++ import.c    28 Aug 2007 00:15:09 -0000      1.184
@@ -353,7 +353,9 @@
     li->rev_old = li->rev_new = NULL;
     p->data = li;
     (void) addnode (ulist, p);
-    do_verify (&message, repository, ulist);
+
+    if (do_verify (&message, repository, ulist))
+       error (1, 0, "correct above errors first!");
 
     /*
      * Make all newly created directories writable.  Should really use a more

Index: logmsg.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/logmsg.c,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -b -r1.107 -r1.108
--- logmsg.c    27 Aug 2007 02:11:05 -0000      1.107
+++ logmsg.c    28 Aug 2007 00:15:09 -0000      1.108
@@ -408,7 +408,7 @@
    included the -m attribute.  unlike the do_editor function, this is 
    independant of the running of an editor for getting a message.
  */
-void
+int
 do_verify (char **messagep, const char *repository, List *changes)
 {
     int err;
@@ -417,13 +417,11 @@
 
     if (current_parsed_root->isremote)
        /* The verification will happen on the server.  */
-       return;
+       return 0;
 
-    /* FIXME? Do we really want to skip this on noexec?  What do we do
-       for the other administrative files?  */
     /* EXPLAIN: Why do we check for repository == NULL here? */
-    if (noexec || repository == NULL)
-       return;
+    if (repository == NULL)
+       return 0;
 
     /* Get the name of the verification script to run  */
 
@@ -435,19 +433,21 @@
     {
        int saved_errno = errno;
        /* Since following error() exits, delete the temp file now.  */
-       if (data.fname != NULL && unlink_file( data.fname ) < 0)
+       if (data.fname != NULL && unlink_file (data.fname) < 0)
            error (0, errno, "cannot remove %s", data.fname);
        free (data.fname);
 
        errno = saved_errno;
-       error (1, err == -1 ? errno : 0, "Message verification failed");
+       error (err == -1 ? 1: 0, err == -1 ? errno : 0,
+              "Message verification failed.");
+       return err;
     }
 
     /* Return if no temp file was created.  That means that we didn't call any
      * verifymsg scripts.
      */
     if (data.fname == NULL)
-       return;
+       return 0;
 
     /* Get the mod time and size of the possibly new log message
      * in always and stat modes.
@@ -516,6 +516,8 @@
     if (unlink_file (data.fname) < 0)
        error (0, errno, "cannot remove `%s'", data.fname);
     free (data.fname);
+
+    return 0;
 }
 
 

Index: logmsg.h
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/logmsg.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- logmsg.h    24 Apr 2006 18:50:26 -0000      1.2
+++ logmsg.h    28 Aug 2007 00:15:09 -0000      1.3
@@ -38,4 +38,11 @@
                                   add, or import, NULL for remove */
 };
 
+
+
+#define LOGMSG_REREAD_NEVER 0  /* do_verify - never  reread message */
+#define LOGMSG_REREAD_ALWAYS 1 /* do_verify - always reread message */
+#define LOGMSG_REREAD_STAT 2   /* do_verify - reread message if changed */
+int do_verify (char **messagep, const char *repository, List *changes);
+
 #endif /* LOGMSG_H */

Index: parseinfo.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/parseinfo.c,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -b -r1.89 -r1.90
--- parseinfo.c 27 Aug 2007 02:11:06 -0000      1.89
+++ parseinfo.c 28 Aug 2007 00:15:09 -0000      1.90
@@ -21,6 +21,7 @@
 
 /* CVS includes.  */
 #include "history.h"
+#include "logmsg.h"
 #include "repos.h"
 
 #include "cvs.h"

Index: sanity.sh
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/sanity.sh,v
retrieving revision 1.1185
retrieving revision 1.1186
diff -u -b -r1.1185 -r1.1186
--- sanity.sh   25 Aug 2007 03:17:59 -0000      1.1185
+++ sanity.sh   28 Aug 2007 00:15:10 -0000      1.1186
@@ -20437,10 +20437,17 @@
 
          cd ../first-dir
          echo line2 >>file1
-         dotest_fail info-v2 "${testcvs} -q ci -m bogus" \
+         dotest_fail info-v2a "$testcvs -q ci -m bogus" \
 "vscript $tempname file1 1\.5
 No BugId found\.
-${SPROG} \[commit aborted\]: Message verification failed"
+$SPROG commit: Message verification failed\.
+$SPROG \[commit aborted\]: correct above errors first!"
+
+         dotest_fail info-v2b "$testcvs -q ci -m bogus file1" \
+"vscript $tempname file1 1\.5
+No BugId found\.
+$SPROG commit: Message verification failed\.
+$SPROG \[commit aborted\]: correct above errors first!"
 
          cat >${TESTDIR}/comment.tmp <<EOF
 BugId: 42
@@ -20460,7 +20467,8 @@
            "${testcvs} import -m bogus first-dir/another x y" \
 "vscript $tempname - Imported sources NONE
 No BugId found\.
-${SPROG} \[import aborted\]: Message verification failed"
+$SPROG import: Message verification failed\.
+$SPROG \[import aborted\]: correct above errors first!"
 
          # now verify that directory dependent verifymsgs work
          dotest info-v5 \
@@ -20491,7 +20499,8 @@
              "${testcvs} import -m bogus first-dir/yet-another/and-another x 
y" \
 "vscript2 $tempname - Imported sources NONE
 $CVSROOT_DIRNAME/first-dir/yet-another/and-another
-$SPROG \[import aborted\]: Message verification failed"
+$SPROG import: Message verification failed\.
+$SPROG \[import aborted\]: correct above errors first!"
          else
            dotest info-v6 \
              "${testcvs} import -m bogus first-dir/yet-another/and-another x 
y" \
@@ -20507,14 +20516,17 @@
          # The second text below occurs on Cygwin, where I assume execvp
          # does not return to let CVS print the error message when its
          # argument does not exist.
-         dotest_fail info-v7 "${testcvs} import -m bogus missing-script x y" \
-"${SPROG} import: cannot exec ${TESTDIR}/bogus: No such file or directory
-${SPROG} \[import aborted\]: Message verification failed" \
-"${SPROG} \[import aborted\]: Message verification failed"
-
-         dotest_fail info-v8 "${testcvs} import -m bogus missing-var x y" \
-"${SPROG} import: verifymsg:4: no such user variable \${=Bogus}
-${SPROG} \[import aborted\]: Message verification failed"
+         dotest_fail info-v7 "$testcvs import -m bogus missing-script x y" \
+"$SPROG import: cannot exec $TESTDIR/bogus: No such file or directory
+$SPROG import: Message verification failed\.
+$SPROG \[import aborted\]: correct above errors first!" \
+"$SPROG import: Message verification failed\.
+$SPROG \[import aborted\]: correct above errors first!"
+
+         dotest_fail info-v8 "$testcvs import -m bogus missing-var x y" \
+"$SPROG import: verifymsg:4: no such user variable \${=Bogus}
+$SPROG import: Message verification failed\.
+$SPROG \[import aborted\]: correct above errors first!"
 
          rm file2
          cd ..




reply via email to

[Prev in Thread] Current Thread [Next in Thread]