version 1.251, 2009/02/21 13:44:18 |
version 1.252, 2009/02/21 14:50:53 |
|
|
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); |
|
|
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); |
|
|
} |
} |
|
|
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)); |
|
|
|
|
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); |
|
|
*/ |
*/ |
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); |
|
|
|
|
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; |
|
|
|
|
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", |
|
|
} |
} |
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); |
|
|
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," |
|
|
} 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", |