cvs-cvs
[Top][All Lists]
Advanced

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

[Cvs-cvs] ccvs/src ChangeLog sanity.sh status.c subr.c su...


From: Derek Robert Price
Subject: [Cvs-cvs] ccvs/src ChangeLog sanity.sh status.c subr.c su...
Date: Thu, 25 Sep 2008 13:24:37 +0000

CVSROOT:        /cvsroot/cvs
Module name:    ccvs
Changes by:     Derek Robert Price <dprice>     08/09/25 13:24:37

Modified files:
        src            : ChangeLog sanity.sh status.c subr.c subr.h 
                         tag.c update.c 

Log message:
        * status.c, update.c: Some cleanup.
        * subr.c (dir_append_dirs): Extend to ignore ./*.  Improve header block
        comment.
        * tag.c: Some cleanup.
        (check_fileproc): Improve error message.
        * sanity.sh (basica-4a): Update to compensate for new error message.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/ChangeLog?cvsroot=cvs&r1=1.3613&r2=1.3614
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/sanity.sh?cvsroot=cvs&r1=1.1210&r2=1.1211
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/status.c?cvsroot=cvs&r1=1.69&r2=1.70
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/subr.c?cvsroot=cvs&r1=1.174&r2=1.175
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/subr.h?cvsroot=cvs&r1=1.23&r2=1.24
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/tag.c?cvsroot=cvs&r1=1.158&r2=1.159
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/update.c?cvsroot=cvs&r1=1.284&r2=1.285

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/ChangeLog,v
retrieving revision 1.3613
retrieving revision 1.3614
diff -u -b -r1.3613 -r1.3614
--- ChangeLog   22 Sep 2008 18:01:43 -0000      1.3613
+++ ChangeLog   25 Sep 2008 13:24:35 -0000      1.3614
@@ -1,3 +1,12 @@
+2008-09-25  Derek R. Price  <address@hidden>
+
+       * status.c, update.c: Some cleanup.
+       * subr.c (dir_append_dirs): Extend to ignore ./*.  Improve header block
+       comment.
+       * tag.c: Some cleanup.
+       (check_fileproc): Improve error message.
+       * sanity.sh (basica-4a): Update to compensate for new error message.
+
 2008-09-22  Derek R. Price  <address@hidden>
 
        * repos.c (Name_Repository): Clean up and simplify.

Index: sanity.sh
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/sanity.sh,v
retrieving revision 1.1210
retrieving revision 1.1211
diff -u -b -r1.1210 -r1.1211
--- sanity.sh   22 Sep 2008 18:01:01 -0000      1.1210
+++ sanity.sh   25 Sep 2008 13:24:35 -0000      1.1211
@@ -3531,7 +3531,7 @@
 "${SPROG}"' add: scheduling file `ssfile'\'' for addition
 '"${SPROG}"' add: use .'"${SPROG}"' commit. to add this file permanently'
          dotest_fail basica-4a "$testcvs tag tag0 ssfile" \
-"$SPROG tag: Nothing known about \`ssfile'
+"$SPROG tag: Nothing known about \`ssfile' (did you neglect to commit 
it$QUESTION)
 $SPROG \[tag aborted\]: correct the above errors first!"
          cd ../..
 

Index: status.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/status.c,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -b -r1.69 -r1.70
--- status.c    24 Apr 2006 18:50:27 -0000      1.69
+++ status.c    25 Sep 2008 13:24:36 -0000      1.70
@@ -79,14 +79,14 @@
     argc -= optind;
     argv += optind;
 
-    wrap_setup ();
+    wrap_setup();
 
 #ifdef CLIENT_SUPPORT
     if (current_parsed_root->isremote)
     {
-       start_server ();
+       start_server();
 
-       ign_setup ();
+       ign_setup();
 
        if (long_format)
            send_arg("-v");
@@ -112,7 +112,7 @@
        send_file_names (argc, argv, SEND_EXPAND_WILD);
 
        send_to_server ("status\012", 0);
-       err = get_responses_and_close ();
+       err = get_responses_and_close();
 
        return err;
     }
@@ -123,9 +123,11 @@
                           NULL, NULL, argc, argv, local, W_LOCAL,
                           0, CVS_LOCK_READ, NULL, 1, NULL);
 
-    return (err);
+    return err;
 }
 
+
+
 /*
  * display the status of a file
  */
@@ -194,9 +196,17 @@
            break;
     }
 
-    cvs_output ("\
-===================================================================\n", 0);
-    if (vers->ts_user == NULL)
+    cvs_output (
+"===================================================================\n",
+               0);
+    if (vers->ts_user)
+    {
+       char *buf;
+       buf = Xasprintf ("File: %-17s\tStatus: %s\n\n", finfo->file, sstat);
+       cvs_output (buf, 0);
+       free (buf);
+    }
+    else
     {
        cvs_output ("File: no file ", 0);
        cvs_output (finfo->file, 0);
@@ -204,21 +214,14 @@
        cvs_output (sstat, 0);
        cvs_output ("\n\n", 0);
     }
-    else
-    {
-       char *buf;
-       buf = Xasprintf ("File: %-17s\tStatus: %s\n\n", finfo->file, sstat);
-       cvs_output (buf, 0);
-       free (buf);
-    }
 
-    if (vers->vn_user == NULL)
+    if (!vers->vn_user)
     {
        cvs_output ("   Working revision:\tNo entry for ", 0);
        cvs_output (finfo->file, 0);
        cvs_output ("\n", 0);
     }
-    else if (vers->vn_user[0] == '0' && vers->vn_user[1] == '\0')
+    else if (STREQ (vers->vn_user, "0"))
        cvs_output ("   Working revision:\tNew file!\n", 0);
     else
     {
@@ -241,7 +244,7 @@
        cvs_output ("\n", 0);
     }
 
-    if (vers->vn_rcs == NULL)
+    if (!vers->vn_rcs)
        cvs_output ("   Repository revision:\tNo revision control file\n", 0);
     else
     {
@@ -251,18 +254,17 @@
        cvs_output (vers->srcfile->print_path, 0);
        cvs_output ("\n", 0);
 
-       node = findnode(vers->srcfile->versions,vers->vn_rcs);
+       node = findnode (vers->srcfile->versions, vers->vn_rcs);
        if (node)
        {
-           RCSVers *v;
-           v=(RCSVers*)node->data;
-           node = findnode(v->other_delta,"commitid");
-           cvs_output("   Commit Identifier:\t", 0);
-           if(node && node->data)
-               cvs_output(node->data, 0);
+           RCSVers *v = node->data;
+           node = findnode (v->other_delta,"commitid");
+           cvs_output ("   Commit Identifier:\t", 0);
+           if (node && node->data)
+               cvs_output (node->data, 0);
            else
-               cvs_output("(none)",0);
-           cvs_output("\n",0);
+               cvs_output ("(none)",0);
+           cvs_output ("\n",0);
        }
     }
 
@@ -273,7 +275,7 @@
        edata = vers->entdata;
        if (edata->tag)
        {
-           if (vers->vn_rcs == NULL)
+           if (!vers->vn_rcs)
            {
                cvs_output ("   Sticky Tag:\t\t", 0);
                cvs_output (edata->tag, 0);
@@ -337,7 +339,7 @@
        if (symbols)
        {
            xrcsnode = finfo->rcs;
-           (void) walklist (symbols, tag_list_proc, NULL);
+           walklist (symbols, tag_list_proc, NULL);
        }
        else
            cvs_output ("\tNo Tags Exist\n", 0);
@@ -345,7 +347,7 @@
 
     cvs_output ("\n", 0);
     freevers_ts (&vers);
-    return (0);
+    return 0;
 }
 
 
@@ -359,8 +361,8 @@
                 const char *update_dir, List *entries)
 {
     if (!quiet)
-       error (0, 0, "Examining %s", update_dir);
-    return (R_PROCESS);
+       error (0, 0, "Examining %s", NULL2DOT (update_dir));
+    return R_PROCESS;
 }
 
 
@@ -375,7 +377,7 @@
     char *buf;
 
     if (RCS_nodeisbranch (xrcsnode, p->key))
-       branch = RCS_whatbranch(xrcsnode, p->key) ;
+       branch = RCS_whatbranch (xrcsnode, p->key);
 
     buf = Xasprintf ("\t%-25s\t(%s: %s)\n", p->key,
                     branch ? "branch" : "revision",
@@ -386,5 +388,5 @@
     if (branch)
        free (branch);
 
-    return (0);
+    return 0;
 }

Index: subr.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/subr.c,v
retrieving revision 1.174
retrieving revision 1.175
diff -u -b -r1.174 -r1.175
--- subr.c      19 Sep 2008 16:15:46 -0000      1.174
+++ subr.c      25 Sep 2008 13:24:36 -0000      1.175
@@ -2399,8 +2399,7 @@
 
 /* Append BASE to DIR and return it in allocated memory.  This is slightly more
  * sophisticated than file_name_concat because it is smart enough to ignore
- * both DIR and BASE when they are both empty and to ignore BASE when it is "."
- * and return the original DIR or BASE as needed.
+ * both DIR and BASE when either is empty and to ignore BASE when it is ".".
  *
  * A NULL DIR is treated like the empty string.  No BASE may be NULL since that
  * terminates the va_arg processing.
@@ -2424,15 +2423,23 @@
 
     va_start (args, dir);
 
-    retval = xstrdup (dir ? dir : "");
+    retval = xstrdup (NULL2MT (dir));
     while ((append = va_arg (args, const char *)) != NULL)
     {
        char *new;
 
        TRACE (TRACE_DATA, "dir_append_dirs (%s, %s)", dir, append);
 
-       if (!strlen (append) || STREQ (append, "."))
-           continue;
+       /* Ignore append of empty string.  */
+       if (!*append) continue;
+
+       /* Ignore append of . with any number of training slashes.  */
+       if (*append == '.')
+       {
+           const char *t = append;
+           while (ISSLASH (*++t));
+           if (!*t) continue;
+       }
 
        if (!strlen (retval))
        {

Index: subr.h
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/subr.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- subr.h      16 Sep 2008 19:24:40 -0000      1.23
+++ subr.h      25 Sep 2008 13:24:36 -0000      1.24
@@ -178,4 +178,7 @@
  */
 #define NULL2DOT(u) (u && *u ? u : ".")
 
+/* Convenience macro for equating a NULL pointer and the empty string.  */
+#define NULL2MT(s) (s ? s : "")
+
 #endif /* !SUBR_H */

Index: tag.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/tag.c,v
retrieving revision 1.158
retrieving revision 1.159
diff -u -b -r1.158 -r1.159
--- tag.c       17 Sep 2008 19:53:31 -0000      1.158
+++ tag.c       25 Sep 2008 13:24:36 -0000      1.159
@@ -22,15 +22,15 @@
 # include <config.h>
 #endif
 
-/* GNULIB headers.  */
+/* GNULIB */
+#include "quote.h"
 #include "save-cwd.h"
 
-/* CVS headers.  */
+/* CVS */
 #include "classify.h"
 #include "ignore.h"
 #include "lock.h"
 #include "parseinfo.h"
-#include "quote.h"
 #include "recurse.h"
 #include "repos.h"
 
@@ -268,7 +268,6 @@
        else
        {
            send_files (argc, argv, local, 0,
-
                        /* I think the -c case is like "cvs status", in
                         * which we really better be correct rather than
                         * being fast; it is just too confusing otherwise.
@@ -408,11 +407,11 @@
 
     mtlist = callerdat;
     p = findnode (mtlist, update_dir);
-    if (p != NULL)
+    if (p)
         tlist = ((struct master_lists *) p->data)->tlist;
     else
         tlist = NULL;
-    if (tlist == NULL || tlist->list->next == tlist->list)
+    if (list_isempty (tlist))
         return err;
 
     ppd.tlist = tlist;
@@ -634,7 +633,9 @@
     if (!vers->srcfile)
     {
         if (!really_quiet)
-           error (0, 0, "Nothing known about %s", quote (finfo->file));
+           error (0, 0,
+                  "Nothing known about %s (did you neglect to commit it?)",
+                  quote (finfo->fullname));
        freevers_ts (&vers);
        freenode (p);
        return 1;
@@ -647,17 +648,17 @@
     p->data = ti = xmalloc (sizeof (struct tag_info));
     memset (ti, 0, sizeof (struct tag_info));
     ti->tag = xstrdup (numtag ? numtag : vers->tag);
-    if (!is_rtag && numtag == NULL && date == NULL)
+    if (!is_rtag && !numtag && !date)
        ti->rev = xstrdup (vers->vn_user);
     else
        ti->rev = RCS_getversion (vers->srcfile, numtag, date,
                                  force_tag_match, NULL);
 
-    if (ti->rev != NULL)
+    if (ti->rev)
     {
         ti->oldrev = RCS_getversion (vers->srcfile, symtag, NULL, 1, NULL);
 
-       if (ti->oldrev == NULL)
+       if (!ti->oldrev)
         {
             if (delete_flag)
             {
@@ -690,7 +691,7 @@
        p->data = NULL;
     }
     freevers_ts (&vers);
-    (void)addnode (tlist, p);
+    addnode (tlist, p);
     return 0;
 }
 
@@ -815,11 +816,11 @@
           err, repos, update_dir);
 
     p = findnode (mtlist, update_dir);
-    if (p != NULL)
+    if (p)
         tlist = ((struct master_lists *) p->data)->tlist;
     else
         tlist = NULL;
-    if (tlist == NULL || tlist->list->next == tlist->list)
+    if (list_isempty (tlist))
         return err;
 
     ppd.tlist = tlist;
@@ -1399,7 +1400,7 @@
 
     if (!quiet)
        error (0, 0, "%s %s", delete_flag ? "Untagging" : "Tagging",
-               update_dir);
+               NULL2DOT (update_dir));
     return R_PROCESS;
 }
 

Index: update.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/update.c,v
retrieving revision 1.284
retrieving revision 1.285
diff -u -b -r1.284 -r1.285
--- update.c    17 Sep 2008 19:53:31 -0000      1.284
+++ update.c    25 Sep 2008 13:24:37 -0000      1.285
@@ -817,19 +817,16 @@
  * files that should NOT be ignored.
  */
 static void
-update_ignproc (const char *file, const char *dir)
+update_ignproc (const char *file, const char *update_dir)
 {
     struct file_info finfo;
     char *tmp;
 
     memset (&finfo, 0, sizeof (finfo));
     finfo.file = file;
-    finfo.update_dir = dir;
+    finfo.update_dir = update_dir;
 
-    finfo.fullname = tmp = Xasprintf ("%s%s%s",
-                                     dir[0] == '\0' ? "" : dir,
-                                     dir[0] == '\0' ? "" : "/",
-                                     file);
+    finfo.fullname = tmp = dir_append (update_dir, file);
     write_letter (&finfo, '?');
     free (tmp);
 }




reply via email to

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