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

Diff for /src/usr.bin/cvs/diff.c between version 1.30 and 1.31

version 1.30, 2005/04/16 19:05:02 version 1.31, 2005/04/18 21:02:49
Line 482 
Line 482 
         BUF *b1, *b2;          BUF *b1, *b2;
         RCSNUM *r1, *r2;          RCSNUM *r1, *r2;
         RCSFILE *rf;          RCSFILE *rf;
         struct cvs_ent *entp;  
         struct cvsroot *root;          struct cvsroot *root;
   
         if (cfp->cf_type == DT_DIR) {          if (cfp->cf_type == DT_DIR) {
                 if (cfp->cf_cvstat == CVS_FST_UNKNOWN) {                  if (cfp->cf_cvstat == CVS_FST_UNKNOWN) {
                         root = cfp->cf_parent->cf_ddat->cd_root;                          root = cfp->cf_parent->cf_root;
                         cvs_sendreq(root, CVS_REQ_QUESTIONABLE,                          cvs_sendreq(root, CVS_REQ_QUESTIONABLE,
                             CVS_FILE_NAME(cfp));                              CVS_FILE_NAME(cfp));
                 } else {                  } else {
                         root = cfp->cf_ddat->cd_root;                          root = cfp->cf_root;
 #if 0  #if 0
                         if ((cfp->cf_parent == NULL) ||                          if ((cfp->cf_parent == NULL) ||
                             (root != cfp->cf_parent->cf_ddat->cd_root)) {                              (root != cfp->cf_parent->cf_root)) {
                                 cvs_connect(root);                                  cvs_connect(root);
                                 cvs_diff_sendflags(root);                                  cvs_diff_sendflags(root);
                         }                          }
Line 516 
Line 515 
   
         if (cfp->cf_parent != NULL) {          if (cfp->cf_parent != NULL) {
                 dir = cvs_file_getpath(cfp->cf_parent, dfpath, sizeof(dfpath));                  dir = cvs_file_getpath(cfp->cf_parent, dfpath, sizeof(dfpath));
                 root = cfp->cf_parent->cf_ddat->cd_root;                  root = cfp->cf_parent->cf_root;
                 repo = cfp->cf_parent->cf_ddat->cd_repo;                  repo = cfp->cf_parent->cf_repo;
         } else {          } else {
                 dir = ".";                  dir = ".";
                 root = NULL;                  root = NULL;
Line 533 
Line 532 
                 return (0);                  return (0);
         }          }
   
         entp = cvs_ent_getent(diff_file);  
         if (entp == NULL)  
                 return (CVS_EX_DATA);  
   
         if (root->cr_method != CVS_METHOD_LOCAL) {          if (root->cr_method != CVS_METHOD_LOCAL) {
                 if (cvs_sendentry(root, entp) < 0) {                  if (cvs_sendentry(root, cfp) < 0) {
                         cvs_ent_free(entp);  
                         return (CVS_EX_PROTO);                          return (CVS_EX_PROTO);
                 }                  }
         }          }
Line 548 
Line 542 
                 if (root->cr_method != CVS_METHOD_LOCAL)                  if (root->cr_method != CVS_METHOD_LOCAL)
                         cvs_sendreq(root, CVS_REQ_UNCHANGED,                          cvs_sendreq(root, CVS_REQ_UNCHANGED,
                             CVS_FILE_NAME(cfp));                              CVS_FILE_NAME(cfp));
                 cvs_ent_free(entp);  
                 return (0);                  return (0);
         }          }
   
Line 562 
Line 555 
                 if (l == -1 || l >= (int)sizeof(rcspath)) {                  if (l == -1 || l >= (int)sizeof(rcspath)) {
                         errno = ENAMETOOLONG;                          errno = ENAMETOOLONG;
                         cvs_log(LP_ERRNO, "%s", rcspath);                          cvs_log(LP_ERRNO, "%s", rcspath);
   
                         cvs_ent_free(entp);  
                         return (-1);                          return (-1);
                 }                  }
   
                 rf = rcs_open(rcspath, RCS_READ);                  rf = rcs_open(rcspath, RCS_READ);
                 if (rf == NULL) {                  if (rf == NULL) {
                         cvs_ent_free(entp);  
                         return (CVS_EX_DATA);                          return (CVS_EX_DATA);
                 }                  }
   
Line 577 
Line 567 
                     RCS_DIFF_DIV, rcspath);                      RCS_DIFF_DIV, rcspath);
   
                 if (dap->rev1 == NULL)                  if (dap->rev1 == NULL)
                         r1 = entp->ce_rev;                          r1 = cfp->cf_lrev;
                 else {                  else {
                         if ((r1 = rcsnum_parse(dap->rev1)) == NULL) {                          if ((r1 = rcsnum_parse(dap->rev1)) == NULL) {
                                 cvs_ent_free(entp);  
                                 return (CVS_EX_DATA);                                  return (CVS_EX_DATA);
                         }                          }
                 }                  }
Line 589 
Line 578 
                     rcsnum_tostr(r1, buf, sizeof(buf)));                      rcsnum_tostr(r1, buf, sizeof(buf)));
                 b1 = rcs_getrev(rf, r1);                  b1 = rcs_getrev(rf, r1);
   
                 if (r1 != entp->ce_rev)                  if (r1 != cfp->cf_lrev)
                         rcsnum_free(r1);                          rcsnum_free(r1);
   
                 if (dap->rev2 != NULL) {                  if (dap->rev2 != NULL) {
                         cvs_printf("retrieving revision %s\n", dap->rev2);                          cvs_printf("retrieving revision %s\n", dap->rev2);
                         if ((r2 = rcsnum_parse(dap->rev2)) == NULL) {                          if ((r2 = rcsnum_parse(dap->rev2)) == NULL) {
                                 cvs_ent_free(entp);  
                                 return (CVS_EX_DATA);                                  return (CVS_EX_DATA);
                         }                          }
                         b2 = rcs_getrev(rf, r2);                          b2 = rcs_getrev(rf, r2);
Line 632 
Line 620 
                 (void)unlink(path_tmp2);                  (void)unlink(path_tmp2);
         }          }
   
         cvs_ent_free(entp);  
         return (0);          return (0);
 }  }
   

Legend:
Removed from v.1.30  
changed lines
  Added in v.1.31