[BACK]Return to commit.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / cvs

Diff for /src/usr.bin/cvs/commit.c between version 1.66 and 1.67

version 1.66, 2006/05/31 01:26:21 version 1.67, 2006/05/31 23:27:38
Line 150 
Line 150 
 cvs_commit_local(struct cvs_file *cf)  cvs_commit_local(struct cvs_file *cf)
 {  {
         BUF *b;          BUF *b;
           int isnew;
         int l, openflags, rcsflags;          int l, openflags, rcsflags;
         char *d, *f, rbuf[24];          char *d, *f, rbuf[24];
         CVSENTRIES *entlist;          CVSENTRIES *entlist;
Line 168 
Line 169 
         else          else
                 strlcpy(rbuf, "Non-existent", sizeof(rbuf));                  strlcpy(rbuf, "Non-existent", sizeof(rbuf));
   
           isnew = 0;
         if (cf->file_status == FILE_ADDED) {          if (cf->file_status == FILE_ADDED) {
                   isnew = 1;
                 rcsflags = RCS_CREATE;                  rcsflags = RCS_CREATE;
                 openflags = O_CREAT | O_TRUNC | O_WRONLY;                  openflags = O_CREAT | O_TRUNC | O_WRONLY;
                 if (cf->file_rcs != NULL) {                  if (cf->file_rcs != NULL) {
Line 201 
Line 204 
                         rcsflags = RCS_READ | RCS_PARSE_FULLY;                          rcsflags = RCS_READ | RCS_PARSE_FULLY;
                         openflags = O_RDONLY;                          openflags = O_RDONLY;
                         rcs_close(cf->file_rcs);                          rcs_close(cf->file_rcs);
                           isnew = 0;
                 }                  }
   
                 cf->repo_fd = open(cf->file_rpath, openflags);                  cf->repo_fd = open(cf->file_rpath, openflags);
Line 218 
Line 222 
         cvs_printf("%s <- %s\n", cf->file_rpath, cf->file_path);          cvs_printf("%s <- %s\n", cf->file_rpath, cf->file_path);
         cvs_printf("old revision: %s; ", rbuf);          cvs_printf("old revision: %s; ", rbuf);
   
         if (cf->file_status != FILE_ADDED)          if (isnew == 0)
                 d = commit_diff_file(cf);                  d = commit_diff_file(cf);
   
         if (cf->file_status == FILE_REMOVED) {          if (cf->file_status == FILE_REMOVED) {
Line 233 
Line 237 
         cvs_buf_putc(b, '\0');          cvs_buf_putc(b, '\0');
         f = cvs_buf_release(b);          f = cvs_buf_release(b);
   
         if (cf->file_status != FILE_ADDED) {          if (isnew == 0) {
                 if (rcs_deltatext_set(cf->file_rcs,                  if (rcs_deltatext_set(cf->file_rcs,
                     cf->file_rcs->rf_head, d) == -1)                      cf->file_rcs->rf_head, d) == -1)
                         fatal("cvs_commit_local: failed to set delta");                          fatal("cvs_commit_local: failed to set delta");
Line 247 
Line 251 
   
         xfree(f);          xfree(f);
   
         if (cf->file_status != FILE_ADDED)          if (isnew == 0)
                 xfree(d);                  xfree(d);
   
         if (cf->file_status == FILE_REMOVED) {          if (cf->file_status == FILE_REMOVED) {

Legend:
Removed from v.1.66  
changed lines
  Added in v.1.67