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

Diff for /src/usr.bin/cvs/file.c between version 1.251 and 1.252

version 1.251, 2009/02/21 13:44:18 version 1.252, 2009/02/21 14:50:53
Line 240 
Line 240 
         cf->in_attic = 0;          cf->in_attic = 0;
         cf->file_ent = NULL;          cf->file_ent = NULL;
   
           if (cf->fd != -1)
                   cf->file_flags |= FILE_ON_DISK;
   
         if (current_cvsroot->cr_method != CVS_METHOD_LOCAL ||          if (current_cvsroot->cr_method != CVS_METHOD_LOCAL ||
             cvs_server_active == 1)              cvs_server_active == 1)
                 cvs_validate_directory(cf->file_path);                  cvs_validate_directory(cf->file_path);
Line 660 
Line 663 
                 cf->file_ent = NULL;                  cf->file_ent = NULL;
   
         if (cf->file_ent != NULL) {          if (cf->file_ent != NULL) {
                 if (cf->fd != -1 && cf->file_ent->ce_type == CVS_ENT_DIR &&                  if (cf->file_flags & FILE_ON_DISK &&
                       cf->file_ent->ce_type == CVS_ENT_DIR &&
                     cf->file_type != CVS_DIR)                      cf->file_type != CVS_DIR)
                         fatal("%s is supposed to be a directory, but it is not",                          fatal("%s is supposed to be a directory, but it is not",
                             cf->file_path);                              cf->file_path);
                 if (cf->fd != -1 && cf->file_ent->ce_type == CVS_ENT_FILE &&                  if (cf->file_flags & FILE_ON_DISK &&
                       cf->file_ent->ce_type == CVS_ENT_FILE &&
                     cf->file_type != CVS_FILE)                      cf->file_type != CVS_FILE)
                         fatal("%s is supposed to be a file, but it is not",                          fatal("%s is supposed to be a file, but it is not",
                             cf->file_path);                              cf->file_path);
Line 747 
Line 752 
         }          }
   
         ismodified = rcsdead = 0;          ismodified = rcsdead = 0;
         if (cf->fd != -1 && cf->file_ent != NULL) {          if ((cf->file_flags & FILE_ON_DISK) && cf->file_ent != NULL) {
                 if (fstat(cf->fd, &st) == -1)                  if (fstat(cf->fd, &st) == -1)
                         fatal("cvs_file_classify: %s", strerror(errno));                          fatal("cvs_file_classify: %s", strerror(errno));
   
Line 765 
Line 770 
         if ((server_has_file == 1) || (cf->fd != -1))          if ((server_has_file == 1) || (cf->fd != -1))
                 cf->file_flags |= FILE_ON_DISK;                  cf->file_flags |= FILE_ON_DISK;
   
         if (ismodified == 1 && cf->fd != -1 && cf->file_rcs != NULL &&          if (ismodified == 1 &&
               (cf->file_flags & FILE_ON_DISK) && cf->file_rcs != NULL &&
             cf->file_ent != NULL && !RCSNUM_ISBRANCH(cf->file_ent->ce_rev) &&              cf->file_ent != NULL && !RCSNUM_ISBRANCH(cf->file_ent->ce_rev) &&
             cf->file_ent->ce_status != CVS_ENT_ADDED) {              cf->file_ent->ce_status != CVS_ENT_ADDED) {
                 b1 = rcs_rev_getbuf(cf->file_rcs, cf->file_ent->ce_rev, 0);                  b1 = rcs_rev_getbuf(cf->file_rcs, cf->file_ent->ce_rev, 0);
Line 803 
Line 809 
          */           */
         if (cf->file_ent == NULL) {          if (cf->file_ent == NULL) {
                 if (cf->file_rcs == NULL) {                  if (cf->file_rcs == NULL) {
                         if (cf->fd == -1) {                          if (!(cf->file_flags & FILE_ON_DISK)) {
                                 cvs_log(LP_NOTICE,                                  cvs_log(LP_NOTICE,
                                     "nothing known about '%s'",                                      "nothing known about '%s'",
                                     cf->file_path);                                      cf->file_path);
Line 811 
Line 817 
   
                         cf->file_status = FILE_UNKNOWN;                          cf->file_status = FILE_UNKNOWN;
                 } else if (rcsdead == 1 || !(cf->file_flags & FILE_HAS_TAG)) {                  } else if (rcsdead == 1 || !(cf->file_flags & FILE_HAS_TAG)) {
                         if (cf->fd == -1) {                          if (!(cf->file_flags & FILE_ON_DISK)) {
                                 cf->file_status = FILE_UPTODATE;                                  cf->file_status = FILE_UPTODATE;
                         } else if (cvs_cmdop != CVS_OP_ADD) {                          } else if (cvs_cmdop != CVS_OP_ADD) {
                                 cf->file_status = FILE_UNKNOWN;                                  cf->file_status = FILE_UNKNOWN;
Line 827 
Line 833 
   
         switch (cf->file_ent->ce_status) {          switch (cf->file_ent->ce_status) {
         case CVS_ENT_ADDED:          case CVS_ENT_ADDED:
                 if (cf->fd == -1) {                  if (!(cf->file_flags & FILE_ON_DISK)) {
                         if (cvs_cmdop != CVS_OP_REMOVE) {                          if (cvs_cmdop != CVS_OP_REMOVE) {
                                 cvs_log(LP_NOTICE,                                  cvs_log(LP_NOTICE,
                                     "warning: new-born %s has disappeared",                                      "warning: new-born %s has disappeared",
Line 845 
Line 851 
                 }                  }
                 break;                  break;
         case CVS_ENT_REMOVED:          case CVS_ENT_REMOVED:
                 if (cf->fd != -1) {                  if (cf->file_flags & FILE_ON_DISK) {
                         cvs_log(LP_NOTICE,                          cvs_log(LP_NOTICE,
                             "%s should be removed but is still there",                              "%s should be removed but is still there",
                             cf->file_path);                              cf->file_path);
Line 869 
Line 875 
                 if (cf->file_rcs == NULL || cf->file_rcsrev == NULL ||                  if (cf->file_rcs == NULL || cf->file_rcsrev == NULL ||
                     rcsdead == 1 || (reset_tag == 1 && cf->in_attic == 1) ||                      rcsdead == 1 || (reset_tag == 1 && cf->in_attic == 1) ||
                     (notag == 1 && tag != NULL)) {                      (notag == 1 && tag != NULL)) {
                         if (cf->fd == -1 && server_has_file == 0) {                          if (!(cf->file_flags & FILE_ON_DISK)) {
                                 cvs_log(LP_NOTICE,                                  cvs_log(LP_NOTICE,
                                     "warning: %s's entry exists but"                                      "warning: %s's entry exists but"
                                     " is no longer in the repository,"                                      " is no longer in the repository,"
Line 899 
Line 905 
                 } else if (cf->file_rcsrev == NULL) {                  } else if (cf->file_rcsrev == NULL) {
                         cf->file_status = FILE_UNLINK;                          cf->file_status = FILE_UNLINK;
                 } else {                  } else {
                         if (cf->fd == -1 && server_has_file == 0) {                          if (!(cf->file_flags & FILE_ON_DISK)) {
                                 if (cvs_cmdop != CVS_OP_REMOVE) {                                  if (cvs_cmdop != CVS_OP_REMOVE) {
                                         cvs_log(LP_NOTICE,                                          cvs_log(LP_NOTICE,
                                             "warning: %s was lost",                                              "warning: %s was lost",

Legend:
Removed from v.1.251  
changed lines
  Added in v.1.252