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 recurse.c sanity.sh


From: Derek Robert Price
Subject: [Cvs-cvs] ccvs/src ChangeLog commit.c recurse.c sanity.sh
Date: Mon, 29 Sep 2008 02:28:51 +0000

CVSROOT:        /cvsroot/cvs
Module name:    ccvs
Changes by:     Derek Robert Price <dprice>     08/09/29 02:28:51

Modified files:
        src            : ChangeLog commit.c recurse.c sanity.sh 

Log message:
        Fixes recurse.c error from two commits back by correctly preserving
        and composing update_dir.  Incidentally fixes a few other minor bugs.
        * commit.c (commit_direntproc): Handle corrected update_dir.
        * recurse.c (do_dir_proc): Preserve update_dir.  Clean up.
        * sanity.sh: Compensate for correctly preserved update_dir.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/ChangeLog?cvsroot=cvs&r1=1.3620&r2=1.3621
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/commit.c?cvsroot=cvs&r1=1.287&r2=1.288
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/recurse.c?cvsroot=cvs&r1=1.136&r2=1.137
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/sanity.sh?cvsroot=cvs&r1=1.1212&r2=1.1213

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/ChangeLog,v
retrieving revision 1.3620
retrieving revision 1.3621
diff -u -b -r1.3620 -r1.3621
--- ChangeLog   29 Sep 2008 02:19:15 -0000      1.3620
+++ ChangeLog   29 Sep 2008 02:28:50 -0000      1.3621
@@ -1,5 +1,11 @@
 2008-09-28  Derek R. Price  <address@hidden>
 
+       Fixes recurse.c error from two commits back by correctly preserving
+       and composing update_dir.  Incidentally fixes a few other minor bugs.
+       * commit.c (commit_direntproc): Handle corrected update_dir.
+       * recurse.c (do_dir_proc): Preserve update_dir.  Clean up.
+       * sanity.sh: Compensate for correctly preserved update_dir.
+
        * ls.c (ls_dirleaveproc): Reindent, add quoting in error message.
 
        * find_names.c (Find_Directories): Output returned list in traces.

Index: commit.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/commit.c,v
retrieving revision 1.287
retrieving revision 1.288
diff -u -b -r1.287 -r1.288
--- commit.c    19 Sep 2008 17:25:44 -0000      1.287
+++ commit.c    29 Sep 2008 02:28:50 -0000      1.288
@@ -1737,7 +1737,7 @@
        return R_SKIP_ALL;
 
     /* find the update list for this dir */
-    p = findnode (mulist, update_dir);
+    p = findnode (mulist, NULL2DOT (update_dir));
     if (p != NULL)
        ulist = ((struct master_lists *) p->data)->ulist;
     else

Index: recurse.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/recurse.c,v
retrieving revision 1.136
retrieving revision 1.137
diff -u -b -r1.136 -r1.137
--- recurse.c   29 Sep 2008 02:09:42 -0000      1.136
+++ recurse.c   29 Sep 2008 02:28:50 -0000      1.137
@@ -971,7 +971,6 @@
     List *sdirlist;
     char *srepository;
     Dtype dir_return = R_PROCESS;
-    int stripped_dot = 0;
     int err = 0;
     struct saved_cwd cwd;
     char *saved_update_dir;
@@ -1013,27 +1012,7 @@
     }
 
     saved_update_dir = update_dir;
-    update_dir = xmalloc (strlen (saved_update_dir)
-                         + strlen (dir)
-                         + 5);
-    strcpy (update_dir, saved_update_dir);
-
-    /* set up update_dir - skip dots if not at start */
-    if (STREQ (dir, "."))
-    {
-       if (update_dir[0] == '\0')
-           strcpy (update_dir, dir);
-    }
-    else
-    {
-       if (update_dir[0])
-       {
-           strcat (update_dir, "/");
-           strcat (update_dir, dir);
-       }
-       else
-           strcpy (update_dir, dir);
-    }
+    update_dir = dir_append (update_dir, dir);
 
     /* Here we need a plausible repository name for the sub-directory.  We
      * create one by concatenating the new directory name onto the previous
@@ -1058,19 +1037,11 @@
     {
        char *cvsadmdir;
 
-       cvsadmdir = xmalloc (strlen (dir)
-                            + sizeof (CVSADM_REP)
-                            + sizeof (CVSADM_ENT)
-                            + 80);
-
-       strcpy (cvsadmdir, dir);
-       strcat (cvsadmdir, "/");
-       strcat (cvsadmdir, CVSADM);
+       cvsadmdir = dir_append (dir, CVSADM);
        if (isdir (cvsadmdir))
        {
-           strcpy (cvsadmdir, dir);
-           strcat (cvsadmdir, "/");
-           strcat (cvsadmdir, CVSADM_REP);
+           free (cvsadmdir);
+           cvsadmdir = dir_append (dir, CVSADM_REP);
            if (!isfile (cvsadmdir))
            {
                /* Some commands like update may have printed "? foo" but
@@ -1084,9 +1055,8 @@
            /* Likewise for CVS/Entries.  */
            if (dir_return != R_SKIP_ALL)
            {
-               strcpy (cvsadmdir, dir);
-               strcat (cvsadmdir, "/");
-               strcat (cvsadmdir, CVSADM_ENT);
+               free (cvsadmdir);
+               cvsadmdir = dir_append (dir, CVSADM_ENT);
                if (!isfile (cvsadmdir))
                {
                    /* Some commands like update may have printed "? foo" but
@@ -1182,13 +1152,6 @@
        if (frame->flags == R_SKIP_DIRS)
            dir_return = R_SKIP_DIRS;
 
-       /* remember if the `.' will be stripped for subsequent dirs */
-       if (STREQ (update_dir, "."))
-       {
-           update_dir[0] = '\0';
-           stripped_dot = 1;
-       }
-
        /* make the recursive call */
        xframe = *frame;
        xframe.flags = dir_return;
@@ -1197,12 +1160,7 @@
         * CVS/Repository to figure it out per directory.
         */
        if (repository)
-       {
-           if (STREQ (dir, "."))
-               xframe.repository = xstrdup (repository);
-           else
-               xframe.repository = Xasprintf ("%s/%s", repository, dir);
-       }
+           xframe.repository = dir_append (repository, dir);
        else
            xframe.repository = NULL;
        err += do_recursion (&xframe);
@@ -1212,10 +1170,6 @@
            xframe.repository = NULL;
        }
 
-       /* put the `.' back if necessary */
-       if (stripped_dot)
-           (void) strcpy (update_dir, ".");
-
        /* call-back dir leave proc (if any) */
        if (process_this_directory && frame->dirleaveproc != NULL)
            err = frame->dirleaveproc (frame->callerdat, dir, err, update_dir,

Index: sanity.sh
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/sanity.sh,v
retrieving revision 1.1212
retrieving revision 1.1213
diff -u -b -r1.1212 -r1.1213
--- sanity.sh   25 Sep 2008 22:26:01 -0000      1.1212
+++ sanity.sh   29 Sep 2008 02:28:50 -0000      1.1213
@@ -3783,7 +3783,7 @@
          cd ..
          rm -r 1
          mkdir 2; cd 2
-         dotest basicb-0d "${testcvs} -q co -l ." "U topfile"
+         dotest basicb-0d "$testcvs -q co -l ." "U \./topfile"
          # Now test the ability to run checkout on an existing working
          # directory without having it lose its mind.  I don't know
          # whether this is tested elsewhere in sanity.sh.  A more elaborate
@@ -3933,7 +3933,7 @@
          # Create a second directory.
          mkdir 1
          cd 1
-         dotest basicb-14 "${testcvs} -q co -l ." 'U topfile'
+         dotest basicb-14 "$testcvs -q co -l ." 'U \./topfile'
          mkdir second-dir
          dotest basicb-15 "${testcvs} add second-dir" \
 "Directory ${CVSROOT_DIRNAME}/second-dir added to the repository"
@@ -8103,9 +8103,6 @@
 rcsinfo
 taginfo
 verifymsg
-Emptydir
-
-CVSROOT/Emptydir:
 
 first-dir:
 file1
@@ -8134,9 +8131,6 @@
 ---- $ISO8601DATE 1\.[0-9][0-9]*        rcsinfo
 ---- $ISO8601DATE 1\.[0-9][0-9]*        taginfo
 ---- $ISO8601DATE 1\.[0-9][0-9]*        verifymsg
-d--- $ISO8601DATE            Emptydir
-
-CVSROOT/Emptydir:
 
 first-dir:
 ---- $ISO8601DATE 1\.1        file1
@@ -8165,9 +8159,6 @@
 /rcsinfo/1\.[0-9][0-9]*/$DATE//
 /taginfo/1\.[0-9][0-9]*/$DATE//
 /verifymsg/1\.[0-9][0-9]*/$DATE//
-D/Emptydir////
-
-CVSROOT/Emptydir:
 
 first-dir:
 /file1/1\.1/$DATE//
@@ -8195,9 +8186,6 @@
 rcsinfo
 taginfo
 verifymsg
-Emptydir
-
-CVSROOT/Emptydir:
 
 first-dir:
 file1
@@ -8210,9 +8198,6 @@
 d--- $ISO8601DATE            first-dir
 
 CVSROOT:
-d--- $ISO8601DATE            Emptydir
-
-CVSROOT/Emptydir:
 
 first-dir:
 ---- $ISO8601DATE 1\.1        file1
@@ -8227,9 +8212,6 @@
 d--- $ISO8601DATE            first-dir
 
 CVSROOT:
-d--- $ISO8601DATE            Emptydir
-
-CVSROOT/Emptydir:
 
 first-dir:
 ---- $ISO8601DATE 1\.1        file1
@@ -13538,21 +13520,22 @@
          ############################################################
          # Check out the whole repository
          mkdir 1; cd 1
-         dotest modules-1 "${testcvs} -q co ." 'U CVSROOT/checkoutlist
-U CVSROOT/commitinfo
-U CVSROOT/config
-U CVSROOT/cvswrappers
-U CVSROOT/loginfo
-U CVSROOT/modules
-U CVSROOT/notify
-U CVSROOT/postadmin
-U CVSROOT/postproxy
-U CVSROOT/posttag
-U CVSROOT/postwatch
-U CVSROOT/preproxy
-U CVSROOT/rcsinfo
-U CVSROOT/taginfo
-U CVSROOT/verifymsg'
+         dotest modules-1 "$testcvs -q co ." \
+'U \./CVSROOT/checkoutlist
+U \./CVSROOT/commitinfo
+U \./CVSROOT/config
+U \./CVSROOT/cvswrappers
+U \./CVSROOT/loginfo
+U \./CVSROOT/modules
+U \./CVSROOT/notify
+U \./CVSROOT/postadmin
+U \./CVSROOT/postproxy
+U \./CVSROOT/posttag
+U \./CVSROOT/postwatch
+U \./CVSROOT/preproxy
+U \./CVSROOT/rcsinfo
+U \./CVSROOT/taginfo
+U \./CVSROOT/verifymsg'
          echo "# made a change" >>CVSROOT/modules
          dotest modules-1d "${testcvs} -q ci -m add-modules" \
 "$CVSROOT_DIRNAME/CVSROOT/modules,v  <--  CVSROOT/modules
@@ -13829,10 +13812,10 @@
          # Test checking out everything.
          mkdir 1
          cd 1
-         dotest modules-155b "${testcvs} -q co world" \
-"U CVSROOT/${DOTSTAR}
-U first-dir/subdir/a
-U first-dir/subdir/b"
+         dotest modules-155b "$testcvs -q co world" \
+"U \./CVSROOT/$DOTSTAR
+U \./first-dir/subdir/a
+U \./first-dir/subdir/b"
          cd ..
          rm -rf 1
 
@@ -31834,7 +31817,7 @@
  *-> Name_Repository ((null), )
  *-> fileattr_startdir ($TESTDIR/root1)
  *-> fileattr_write ($TESTDIR/root1)
- *-> Write_Template (\., ${TESTDIR}/root1)
+ *-> Write_Template (, ${TESTDIR}/root1)
 ${CPROG} update: Updating \.
  *-> Name_Repository ((null), )
  *-> fileattr_startdir ($TESTDIR/root1)




reply via email to

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