[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.136 and 1.137

version 1.136, 2006/04/05 01:38:55 version 1.137, 2006/04/14 02:45:35
Line 253 
Line 253 
                 }                  }
   
                 cfp->cf_repo = xstrdup(repo);                  cfp->cf_repo = xstrdup(repo);
                 if (((mkdir(path, mode) == -1) && (errno != EEXIST)) ||                  if ((mkdir(path, mode) == -1 && errno != EEXIST) ||
                     (cvs_mkadmin(path, cfp->cf_root->cr_str, cfp->cf_repo,                      cvs_mkadmin(path, cfp->cf_root->cr_str, cfp->cf_repo,
                     NULL, NULL, 0) < 0)) {                      NULL, NULL, 0) < 0) {
                         cvs_file_free(cfp);                          cvs_file_free(cfp);
                         return (NULL);                          return (NULL);
                 }                  }
Line 575 
Line 575 
         if (cb == NULL)          if (cb == NULL)
                 callit = 0;                  callit = 0;
   
         if ((cvs_cmdop == CVS_OP_SERVER) && (type != DT_DIR))          if (cvs_cmdop == CVS_OP_SERVER && type != DT_DIR)
                 callit = 0;                  callit = 0;
   
         if ((root->cr_method == CVS_METHOD_LOCAL) && (type != DT_DIR))          if (root->cr_method == CVS_METHOD_LOCAL && type != DT_DIR)
                 callit = 0;                  callit = 0;
   
         if (!(base->cf_flags & CVS_FILE_ONDISK))          if (!(base->cf_flags & CVS_FILE_ONDISK))
Line 593 
Line 593 
          * If we have a normal file, pass it as well.           * If we have a normal file, pass it as well.
          */           */
         if (type != DT_DIR) {          if (type != DT_DIR) {
                 if ((cb != NULL) && ((cvs_error = cb(cf, arg)) != CVS_EX_OK))                  if (cb != NULL && (cvs_error = cb(cf, arg)) != CVS_EX_OK)
                         goto fail;                          goto fail;
         } else {          } else {
                 /*                  /*
Line 645 
Line 645 
   
                 /* special case */                  /* special case */
                 if (*pp == '.') {                  if (*pp == '.') {
                         if ((*(pp + 1) == '.') && (*(pp + 2) == '\0')) {                          if (*(pp + 1) == '.' && *(pp + 2) == '\0') {
                                 /* request to go back to parent */                                  /* request to go back to parent */
                                 if (cf->cf_parent == NULL) {                                  if (cf->cf_parent == NULL) {
                                         cvs_log(LP_NOTICE,                                          cvs_log(LP_NOTICE,
Line 747 
Line 747 
                 return (-1);                  return (-1);
         }          }
   
         if ((stat(pbuf, &st) == 0) && S_ISDIR(st.st_mode)) {          if (stat(pbuf, &st) == 0 && S_ISDIR(st.st_mode)) {
                 if (cvs_readrepo(fpath, pbuf, sizeof(pbuf)) == 0)                  if (cvs_readrepo(fpath, pbuf, sizeof(pbuf)) == 0)
                         cf->cf_repo = xstrdup(pbuf);                          cf->cf_repo = xstrdup(pbuf);
         } else {          } else {
Line 790 
Line 790 
         struct cvs_flist dirs;          struct cvs_flist dirs;
         int nfiles, ndirs;          int nfiles, ndirs;
   
         if ((flags & CF_KNOWN) && (cf->cf_cvstat == CVS_FST_UNKNOWN))          if ((flags & CF_KNOWN) && cf->cf_cvstat == CVS_FST_UNKNOWN)
                 return (0);                  return (0);
   
         /*          /*
Line 847 
Line 847 
                         continue;                          continue;
                 }                  }
   
                 if ((de->d_type != DT_DIR) && (flags & CF_NOFILES))                  if (de->d_type != DT_DIR && (flags & CF_NOFILES))
                         continue;                          continue;
   
                 cfp = cvs_file_lget(pbuf, flags, cf, entf, ent);                  cfp = cvs_file_lget(pbuf, flags, cf, entf, ent);
Line 860 
Line 860 
                  * A file is linked to the parent <cf>, a directory                   * A file is linked to the parent <cf>, a directory
                  * is added to the dirs SIMPLEQ list for later use.                   * is added to the dirs SIMPLEQ list for later use.
                  */                   */
                 if ((cfp->cf_type != DT_DIR) && !freecf) {                  if (cfp->cf_type != DT_DIR && !freecf) {
                         SIMPLEQ_INSERT_TAIL(&(cf->cf_files), cfp, cf_list);                          SIMPLEQ_INSERT_TAIL(&(cf->cf_files), cfp, cf_list);
                         nfiles++;                          nfiles++;
                 } else if (cfp->cf_type == DT_DIR) {                  } else if (cfp->cf_type == DT_DIR) {
Line 886 
Line 886 
                 /*                  /*
                  * If we don't want to keep it, free it                   * If we don't want to keep it, free it
                  */                   */
                 if ((cfp->cf_type != DT_DIR) && freecf)                  if (cfp->cf_type != DT_DIR && freecf)
                         cvs_file_free(cfp);                          cvs_file_free(cfp);
         }          }
   
Line 899 
Line 899 
          *           *
          * (Follows the same procedure as above ... can we merge them?)           * (Follows the same procedure as above ... can we merge them?)
          */           */
         while ((entf != NULL) && ((ent = cvs_ent_next(entf)) != NULL)) {          while (entf != NULL && (ent = cvs_ent_next(entf)) != NULL) {
                 if (ent->processed == 1)                  if (ent->processed == 1)
                         continue;                          continue;
                 if (!(flags & CF_RECURSE) && (ent->ce_type == CVS_ENT_DIR))                  if (!(flags & CF_RECURSE) && ent->ce_type == CVS_ENT_DIR)
                         continue;                          continue;
                 if ((flags & CF_NOFILES) && (ent->ce_type != CVS_ENT_DIR))                  if ((flags & CF_NOFILES) && ent->ce_type != CVS_ENT_DIR)
                         continue;                          continue;
   
                 len = cvs_path_cat(fpath, ent->ce_name, pbuf, sizeof(pbuf));                  len = cvs_path_cat(fpath, ent->ce_name, pbuf, sizeof(pbuf));
Line 917 
Line 917 
                         goto done;                          goto done;
                 }                  }
   
                 if ((cfp->cf_type != DT_DIR) && !freecf) {                  if (cfp->cf_type != DT_DIR && !freecf) {
                         SIMPLEQ_INSERT_TAIL(&(cf->cf_files), cfp, cf_list);                          SIMPLEQ_INSERT_TAIL(&(cf->cf_files), cfp, cf_list);
                         nfiles++;                          nfiles++;
                 } else if (cfp->cf_type == DT_DIR) {                  } else if (cfp->cf_type == DT_DIR) {
Line 930 
Line 930 
                                 goto done;                                  goto done;
                 }                  }
   
                 if ((cfp->cf_type != DT_DIR) && freecf)                  if (cfp->cf_type != DT_DIR && freecf)
                         cvs_file_free(cfp);                          cvs_file_free(cfp);
         }          }
   
Line 962 
Line 962 
                 }                  }
   
                 if ((cfp->cf_flags & CVS_FILE_ONDISK) &&                  if ((cfp->cf_flags & CVS_FILE_ONDISK) &&
                     (cvs_file_getdir(cfp, flags, cb, arg, freecf) < 0))                      cvs_file_getdir(cfp, flags, cb, arg, freecf) < 0)
                         goto done;                          goto done;
   
                 if (freecf)                  if (freecf)
Line 972 
Line 972 
         ret = 0;          ret = 0;
         cfp = NULL;          cfp = NULL;
 done:  done:
         if ((cfp != NULL) && freecf)          if (cfp != NULL && freecf)
                 cvs_file_free(cfp);                  cvs_file_free(cfp);
   
         while (!SIMPLEQ_EMPTY(&dirs)) {          while (!SIMPLEQ_EMPTY(&dirs)) {
Line 1146 
Line 1146 
         if (ret == 0)          if (ret == 0)
                 type = IFTODT(st.st_mode);                  type = IFTODT(st.st_mode);
   
         if ((flags & CF_REPO) && (type != DT_DIR)) {          if ((flags & CF_REPO) && type != DT_DIR) {
                 if ((c = strrchr(path, ',')) == NULL)                  if ((c = strrchr(path, ',')) == NULL)
                         return (NULL);                          return (NULL);
                 *c = '\0';                  *c = '\0';
Line 1157 
Line 1157 
         cfp->cf_parent = parent;          cfp->cf_parent = parent;
         cfp->cf_entry = pent;          cfp->cf_entry = pent;
   
         if ((cfp->cf_type == DT_DIR) && (cfp->cf_parent == NULL))          if (cfp->cf_type == DT_DIR && cfp->cf_parent == NULL)
                 cfp->cf_flags |= CVS_DIRF_BASE;                  cfp->cf_flags |= CVS_DIRF_BASE;
   
         if (ret == 0) {          if (ret == 0) {
Line 1265 
Line 1265 
                 xfree(c);                  xfree(c);
         }          }
   
         if ((cfp->cf_repo != NULL) && (cfp->cf_type == DT_DIR) &&          if (cfp->cf_repo != NULL && cfp->cf_type == DT_DIR &&
             !strcmp(cfp->cf_repo, path))              !strcmp(cfp->cf_repo, path))
                 cfp->cf_cvstat = CVS_FST_UPTODATE;                  cfp->cf_cvstat = CVS_FST_UPTODATE;
   

Legend:
Removed from v.1.136  
changed lines
  Added in v.1.137