cvs-cvs
[Top][All Lists]
Advanced

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

[Cvs-cvs] Changes to ccvs/src/checkin.c [signed-commits2]


From: Derek Robert Price
Subject: [Cvs-cvs] Changes to ccvs/src/checkin.c [signed-commits2]
Date: Tue, 22 Nov 2005 13:03:53 -0500

Index: ccvs/src/checkin.c
diff -u ccvs/src/checkin.c:1.55.6.1 ccvs/src/checkin.c:1.55.6.2
--- ccvs/src/checkin.c:1.55.6.1 Fri Nov 18 20:02:07 2005
+++ ccvs/src/checkin.c  Tue Nov 22 18:03:44 2005
@@ -20,6 +20,13 @@
  * Returns non-zero on error.
  */
 
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+/* CVS */
+#include "base.h"
+
 #include "cvs.h"
 #include "fileattr.h"
 #include "edit.h"
@@ -28,7 +35,7 @@
 Checkin (int type, struct file_info *finfo, char *rev, char *tag,
         char *options, char *message)
 {
-    Vers_TS *vers;
+    Vers_TS *vers, *pvers;
     int set_time;
     char *tocvsPath = NULL;
 
@@ -51,6 +58,7 @@
      */
     assert (finfo->rcs != NULL);
 
+    pvers = Version_TS (finfo, NULL, tag, NULL, 1, 0);
     switch (RCS_checkin (finfo->rcs, finfo->update_dir, finfo->file, message,
                         rev, 0, RCS_FLAGS_KEEPFILE))
     {
@@ -82,20 +90,25 @@
                 && (!strcmp (options, "-ko") || !strcmp (options, "-kb")))
                || !RCS_cmp_file (finfo->rcs, rev, NULL, NULL,
                                  options, finfo->file))
-           {
                /* The existing file is correct.  We don't have to do
                    anything.  */
                set_time = 0;
-           }
            else
+               set_time = 1;
+
+           vers = Version_TS (finfo, NULL, tag, NULL, 1, set_time);
+
+           if (set_time)
            {
                /* The existing file is incorrect.  We need to check
                    out the correct file contents.  */
-               if (RCS_checkout (finfo->rcs, finfo->file, rev, NULL,
-                                 options, RUN_TTY, NULL, NULL) != 0)
+               if (base_checkout (finfo->rcs, finfo, pvers->vn_user,
+                                  vers->vn_rcs, NULL, options,
+                                 cvswrite
+                                 || fileattr_get (finfo->file, "_watched")))
                    error (1, 0, "failed when checking out new copy of %s",
                           finfo->fullname);
-               xchmod (finfo->file, 1);
+               base_copy (finfo, rev, "y");
                set_time = 1;
            }
 
@@ -109,7 +122,6 @@
                xchmod (finfo->file, 0);
 
            /* Re-register with the new data.  */
-           vers = Version_TS (finfo, NULL, tag, NULL, 1, set_time);
            if (strcmp (vers->options, "-V4") == 0)
                vers->options[0] = '\0';
            Register (finfo->entries, finfo->file, vers->vn_rcs, vers->ts_user,
@@ -164,7 +176,7 @@
        if (set_time)
            /* Need to update the checked out file on the client side.  */
            server_updated (finfo, vers, SERVER_UPDATED,
-                           (mode_t) -1, NULL, NULL, false);
+                           (mode_t) -1, NULL, NULL, true);
        else
            server_checked_in (finfo->file, finfo->update_dir,
                               finfo->repository);




reply via email to

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