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

Diff of /ccvs/src/update.c

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

revision 1.202.4.26 by scjones, Fri Sep 2 19:37:35 2005 UTC revision 1.202.4.27 by dprice, Thu Sep 22 18:13:29 2005 UTC
# Line 691  update_fileproc (callerdat, finfo) Line 691  update_fileproc (callerdat, finfo)
691                  {                  {
692                      if (vers->ts_conflict)                      if (vers->ts_conflict)
693                      {                      {
694                          if (file_has_conflict (finfo, vers->ts_conflict)                          if (file_has_markers (finfo))
                             || file_has_markers (finfo))  
695                          {                          {
696                              write_letter (finfo, 'C');                              write_letter (finfo, 'C');
697                              retval = 1;                              retval = 1;
# Line 1919  write_letter (finfo, letter) Line 1918  write_letter (finfo, letter)
1918    
1919    
1920    
1921    /* Reregister a file after a merge.  */
1922    static void
1923    RegisterMerge PROTO((struct file_info *finfo, Vers_TS *vers,
1924                         const char *backup, int has_conflicts));
1925    void
1926    RegisterMerge (finfo, vers, backup, has_conflicts)
1927        struct file_info *finfo;
1928        Vers_TS *vers;
1929        const char *backup;
1930        int has_conflicts;
1931    {
1932        /* This file is the result of a merge, which means that it has
1933           been modified.  We use a special timestamp string which will
1934           not compare equal to any actual timestamp.  */
1935        char *cp = NULL;
1936    
1937        if (has_conflicts)
1938        {
1939            time (&last_register_time);
1940            cp = time_stamp (finfo->file);
1941        }
1942        Register (finfo->entries, finfo->file, vers->vn_rcs ? vers->vn_rcs : "0",
1943                  "Result of merge", vers->options, vers->tag, vers->date, cp);
1944        if (cp)
1945            free (cp);
1946    
1947    #ifdef SERVER_SUPPORT
1948        /* Send the new contents of the file before the message.  If we
1949           wanted to be totally correct, we would have the client write
1950           the message only after the file has safely been written.  */
1951        if (server_active)
1952        {
1953            server_copy_file (finfo->file, finfo->update_dir, finfo->repository,
1954                              backup);
1955            server_updated (finfo, vers, SERVER_MERGED, (mode_t) -1, NULL, NULL);
1956        }
1957    #endif
1958    }
1959    
1960    
1961    
1962  /*  /*
1963   * Do all the magic associated with a file which needs to be merged   * Do all the magic associated with a file which needs to be merged
1964   */   */
# Line 1971  merge_file (finfo, vers) Line 2011  merge_file (finfo, vers)
2011             thought needs to go into this, and in the meantime it is safe             thought needs to go into this, and in the meantime it is safe
2012             to treat any such mismatch as an automatic conflict. -twp */             to treat any such mismatch as an automatic conflict. -twp */
2013    
2014  #ifdef SERVER_SUPPORT          retcode = RCS_checkout (finfo->rcs, finfo->file,
2015          if (server_active)                                  vers->vn_rcs, vers->tag,
2016              server_copy_file (finfo->file, finfo->update_dir,                                  vers->options, NULL, NULL, NULL);
2017                                finfo->repository, backup);          xchmod (finfo->file, 1);
 #endif  
2018    
2019          status = checkout_file (finfo, vers, 0, 1, 1);          RegisterMerge (finfo, vers, backup, 1);
2020    
2021          /* Is there a better term than "nonmergeable file"?  What we          /* Is there a better term than "nonmergeable file"?  What we
2022             really mean is, not something that CVS cannot or does not             really mean is, not something that CVS cannot or does not
# Line 2011  merge_file (finfo, vers) Line 2050  merge_file (finfo, vers)
2050      if (strcmp (vers->options, "-V4") == 0)      if (strcmp (vers->options, "-V4") == 0)
2051          vers->options[0] = '\0';          vers->options[0] = '\0';
2052    
     /* This file is the result of a merge, which means that it has  
        been modified.  We use a special timestamp string which will  
        not compare equal to any actual timestamp.  */  
     {  
         char *cp = 0;  
   
         if (status)  
         {  
             (void) time (&last_register_time);  
             cp = time_stamp (finfo->file);  
         }  
         Register (finfo->entries, finfo->file, vers->vn_rcs,  
                   "Result of merge", vers->options, vers->tag,  
                   vers->date, cp);  
         if (cp)  
             free (cp);  
     }  
   
2053      /* fix up the vers structure, in case it is used by join */      /* fix up the vers structure, in case it is used by join */
2054      if (join_rev1)      if (join_rev1)
2055      {      {
# Line 2039  merge_file (finfo, vers) Line 2060  merge_file (finfo, vers)
2060          vers->vn_user = xstrdup (vers->vn_rcs);          vers->vn_user = xstrdup (vers->vn_rcs);
2061      }      }
2062    
2063  #ifdef SERVER_SUPPORT      RegisterMerge (finfo, vers, backup, status);
     /* Send the new contents of the file before the message.  If we  
        wanted to be totally correct, we would have the client write  
        the message only after the file has safely been written.  */  
     if (server_active)  
     {  
         server_copy_file (finfo->file, finfo->update_dir, finfo->repository,  
                           backup);  
         server_updated (finfo, vers, SERVER_MERGED,  
                         (mode_t) -1, (unsigned char *) NULL,  
                         (struct buffer *) NULL);  
     }  
 #endif  
2064    
2065      /* FIXME: the noexec case is broken.  RCS_merge could be doing the      /* FIXME: the noexec case is broken.  RCS_merge could be doing the
2066         xcmp on the temporary files without much hassle, I think.  */         xcmp on the temporary files without much hassle, I think.  */
# Line 2645  join_file (finfo, vers) Line 2654  join_file (finfo, vers)
2654         RCS_checkout above, and we aren't running as the server.         RCS_checkout above, and we aren't running as the server.
2655         However, that is not the normal case, and calling Register         However, that is not the normal case, and calling Register
2656         again won't cost much in that case.  */         again won't cost much in that case.  */
2657      {      RegisterMerge (finfo, vers, backup, status);
         char *cp = 0;  
   
         if (status)  
         {  
             (void) time (&last_register_time);  
             cp = time_stamp (finfo->file);  
         }  
         Register (finfo->entries, finfo->file,  
                   vers->vn_rcs ? vers->vn_rcs : "0", "Result of merge",  
                   vers->options, vers->tag, vers->date, cp);  
         if (cp)  
             free(cp);  
     }  
   
 #ifdef SERVER_SUPPORT  
     if (server_active)  
     {  
         server_copy_file (finfo->file, finfo->update_dir, finfo->repository,  
                           backup);  
         server_updated (finfo, vers, SERVER_MERGED,  
                         (mode_t) -1, (unsigned char *) NULL,  
                         (struct buffer *) NULL);  
     }  
 #endif  
2658    
2659  out:  out:
2660      free (rev1);      free (rev1);

Legend:
Removed from v.1.202.4.26  
changed lines
  Added in v.1.202.4.27

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