/[cvs]/ccvs/src/add.c
ViewVC logotype

Diff of /ccvs/src/add.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.121 by dprice, Sun Sep 4 00:48:21 2005 UTC revision 1.121.4.1 by dprice, Fri Nov 18 20:02:07 2005 UTC
# Line 30  Line 30 
30   */   */
31    
32  #include <assert.h>  #include <assert.h>
33    
34    /* CVS */
35    #include "base.h"
36  #include "cvs.h"  #include "cvs.h"
 #include "save-cwd.h"  
37  #include "fileattr.h"  #include "fileattr.h"
38    
39    /* GNULIB */
40    #include "save-cwd.h"
41    
42  static int add_directory (struct file_info *finfo);  static int add_directory (struct file_info *finfo);
43  static int build_entry (const char *repository, const char *user,  static int build_entry (const char *repository, const char *user,
44                          const char *options, const char *message,                          const char *options, const char *message,
# Line 493  add (int argc, char **argv) Line 498  add (int argc, char **argv)
498                                  error (0, 0,                                  error (0, 0,
499  "Resurrecting file `%s' from revision %s.",  "Resurrecting file `%s' from revision %s.",
500                                         finfo.fullname, prev);                                         finfo.fullname, prev);
501                              status = RCS_checkout (vers->srcfile, finfo.file,                              status = base_checkout (vers->srcfile, &finfo,
502                                                     prev, vers->tag,                                                      NULL, prev, vers->tag,
503                                                     vers->options, RUN_TTY,                                                      vers->options, true);
                                                    NULL, NULL);  
                             xchmod (finfo.file, 1);  
504                              if (status != 0)                              if (status != 0)
505                              {                              {
506                                  error (0, 0, "Failed to resurrect revision %s",                                  error (0, 0, "Failed to resurrect revision %s",
# Line 507  add (int argc, char **argv) Line 510  add (int argc, char **argv)
510                              else                              else
511                              {                              {
512                                  /* I don't actually set vers->ts_user here                                  /* I don't actually set vers->ts_user here
513                                   * because it would confuse server_update().                                   * because it would confuse server_update ().
514                                   */                                   */
515                                    base_copy (&finfo, prev, "n");
516                                  timestamp = time_stamp (finfo.file);                                  timestamp = time_stamp (finfo.file);
517                                  if (!really_quiet)                                  if (!really_quiet)
518                                      write_letter (&finfo, 'U');                                      write_letter (&finfo, 'U');
# Line 543  add (int argc, char **argv) Line 547  add (int argc, char **argv)
547                               */                               */
548                              server_updated (&finfo, vers,                              server_updated (&finfo, vers,
549                                              SERVER_UPDATED,                                              SERVER_UPDATED,
550                                              (mode_t) -1, NULL, NULL);                                              (mode_t) -1, NULL, NULL, true);
551                              /* This is kinda hacky or, at least, it renders the                              /* This is kinda hacky or, at least, it renders the
552                               * name "begin_added_files" obsolete, but we want                               * name "begin_added_files" obsolete, but we want
553                               * the added_files to be counted without triggering                               * the added_files to be counted without triggering
# Line 601  add (int argc, char **argv) Line 605  add (int argc, char **argv)
605                  else                  else
606                  {                  {
607                      int status;                      int status;
608                        char *tmp;
609    
610                      /*                      /*
611                       * There is an RCS file, so remove the "-" from the                       * There is an RCS file, so remove the "-" from the
612                       * version number and restore the file                       * version number and restore the file
613                       */                       */
614                      char *tmp = xstrdup (vers->vn_user + 1);                      memmove (vers->vn_user, vers->vn_user + 1,
615                      (void) strcpy (vers->vn_user, tmp);                               strlen (vers->vn_user));
616                      free (tmp);                      status = base_checkout (vers->srcfile, &finfo,
617                      status = RCS_checkout (vers->srcfile, finfo.file,                                              vers->vn_user, vers->vn_user,
618                                             vers->vn_user, vers->tag,                                              vers->tag, vers->options, cvswrite);
                                            vers->options, RUN_TTY,  
                                            NULL, NULL);  
                     xchmod (finfo.file, cvswrite);  
619                      if (status != 0)                      if (status != 0)
620                      {                      {
621                          error (0, 0, "Failed to resurrect revision %s.",                          error (0, 0, "Failed to resurrect revision %s.",
# Line 625  add (int argc, char **argv) Line 628  add (int argc, char **argv)
628                          /* I don't actually set vers->ts_user here because it                          /* I don't actually set vers->ts_user here because it
629                           * would confuse server_update().                           * would confuse server_update().
630                           */                           */
631                            base_copy (&finfo, vers->vn_user, "n");
632                            xchmod (finfo.file, cvswrite);
633                          tmp = time_stamp (finfo.file);                          tmp = time_stamp (finfo.file);
634                          write_letter (&finfo, 'U');                          write_letter (&finfo, 'U');
635                          if (!quiet)                          if (!quiet)
# Line 643  add (int argc, char **argv) Line 648  add (int argc, char **argv)
648                           */                           */
649                          server_updated (&finfo, vers,                          server_updated (&finfo, vers,
650                                          SERVER_UPDATED,                                          SERVER_UPDATED,
651                                          (mode_t) -1, NULL, NULL);                                          (mode_t) -1, NULL, NULL, true);
652                      }                      }
653                     /* We don't increment added_files here because this isn't                     /* We don't increment added_files here because this isn't
654                      * a change that needs to be committed.                      * a change that needs to be committed.

Legend:
Removed from v.1.121  
changed lines
  Added in v.1.121.4.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26