version 1.11, 2004/12/14 20:19:37 |
version 1.12, 2004/12/14 22:30:48 |
|
|
argc -= optind; |
argc -= optind; |
argv += optind; |
argv += optind; |
|
|
if (argc == 0) { |
if (argc == 0) |
cvs_files = cvs_file_get(".", flags); |
cvs_files = cvs_file_get(".", flags); |
} else { |
else |
cvs_files = cvs_file_getspec(argv, argc, flags); |
cvs_files = cvs_file_getspec(argv, argc, flags); |
} |
|
if (cvs_files == NULL) |
if (cvs_files == NULL) |
return (EX_DATAERR); |
return (EX_DATAERR); |
|
|
|
root = CVS_DIR_ROOT(cvs_files); |
|
if (root == NULL) { |
|
cvs_log(LP_ERR, |
|
"No CVSROOT specified! Please use the `-d' option"); |
|
cvs_log(LP_ERR, |
|
"or set the CVSROOT environment variable."); |
|
return (EX_USAGE); |
|
} |
|
|
|
if ((root->cr_method != CVS_METHOD_LOCAL) && (cvs_connect(root) < 0)) |
|
return (EX_PROTOCOL); |
|
|
cvs_file_examine(cvs_files, cvs_getlog_file, NULL); |
cvs_file_examine(cvs_files, cvs_getlog_file, NULL); |
|
|
root = cvs_files->cf_ddat->cd_root; |
|
if (root->cr_method != CVS_METHOD_LOCAL) { |
if (root->cr_method != CVS_METHOD_LOCAL) { |
cvs_senddir(root, cvs_files); |
cvs_senddir(root, cvs_files); |
if (argc > 0) { |
if (argc > 0) { |
|
|
static int |
static int |
cvs_getlog_file(CVSFILE *cf, void *arg) |
cvs_getlog_file(CVSFILE *cf, void *arg) |
{ |
{ |
|
int ret; |
char *repo, fpath[MAXPATHLEN]; |
char *repo, fpath[MAXPATHLEN]; |
RCSFILE *rf; |
RCSFILE *rf; |
struct cvsroot *root; |
struct cvsroot *root; |
struct cvs_ent *entp; |
struct cvs_ent *entp; |
|
|
cvs_file_getpath(cf, fpath, sizeof(fpath)); |
ret = 0; |
|
|
if (cf->cf_type == DT_DIR) { |
|
if (cf->cf_cvstat == CVS_FST_UNKNOWN) { |
|
root = cf->cf_parent->cf_ddat->cd_root; |
|
cvs_sendreq(root, CVS_REQ_QUESTIONABLE, |
|
CVS_FILE_NAME(cf)); |
|
} else { |
|
root = cf->cf_ddat->cd_root; |
|
if ((cf->cf_parent == NULL) || |
|
(root != cf->cf_parent->cf_ddat->cd_root)) { |
|
cvs_connect(root); |
|
} |
|
|
|
cvs_senddir(root, cf); |
|
} |
|
|
|
return (0); |
|
} else |
|
root = cf->cf_parent->cf_ddat->cd_root; |
|
|
|
rf = NULL; |
rf = NULL; |
if (cf->cf_parent != NULL) { |
root = CVS_DIR_ROOT(cf); |
repo = cf->cf_parent->cf_ddat->cd_repo; |
repo = CVS_DIR_REPO(cf); |
} else { |
|
repo = NULL; |
|
} |
|
|
|
if (cf->cf_cvstat == CVS_FST_UNKNOWN) { |
if ((root->cr_method != CVS_METHOD_LOCAL) && (cf->cf_type == DT_DIR)) { |
if (root->cr_method == CVS_METHOD_LOCAL) |
if (cf->cf_cvstat == CVS_FST_UNKNOWN) |
cvs_printf("? %s\n", fpath); |
ret = cvs_sendreq(root, CVS_REQ_QUESTIONABLE, |
else |
|
cvs_sendreq(root, CVS_REQ_QUESTIONABLE, |
|
CVS_FILE_NAME(cf)); |
CVS_FILE_NAME(cf)); |
return (0); |
else |
|
ret = cvs_senddir(root, cf); |
|
return (ret); |
} |
} |
|
|
|
cvs_file_getpath(cf, fpath, sizeof(fpath)); |
entp = cvs_ent_getent(fpath); |
entp = cvs_ent_getent(fpath); |
if (entp == NULL) |
|
return (-1); |
|
|
|
if ((root->cr_method != CVS_METHOD_LOCAL) && |
|
(cvs_sendentry(root, entp) < 0)) { |
|
cvs_ent_free(entp); |
|
return (-1); |
|
} |
|
|
|
if (root->cr_method != CVS_METHOD_LOCAL) { |
if (root->cr_method != CVS_METHOD_LOCAL) { |
|
if ((entp != NULL) && (cvs_sendentry(root, entp) < 0)) { |
|
cvs_ent_free(entp); |
|
return (-1); |
|
} |
|
|
switch (cf->cf_cvstat) { |
switch (cf->cf_cvstat) { |
|
case CVS_FST_UNKNOWN: |
|
ret = cvs_sendreq(root, CVS_REQ_QUESTIONABLE, |
|
CVS_FILE_NAME(cf)); |
|
break; |
case CVS_FST_UPTODATE: |
case CVS_FST_UPTODATE: |
cvs_sendreq(root, CVS_REQ_UNCHANGED, CVS_FILE_NAME(cf)); |
ret = cvs_sendreq(root, CVS_REQ_UNCHANGED, |
|
CVS_FILE_NAME(cf)); |
break; |
break; |
case CVS_FST_ADDED: |
case CVS_FST_ADDED: |
case CVS_FST_MODIFIED: |
case CVS_FST_MODIFIED: |
cvs_sendreq(root, CVS_REQ_ISMODIFIED, |
ret = cvs_sendreq(root, CVS_REQ_ISMODIFIED, |
CVS_FILE_NAME(cf)); |
CVS_FILE_NAME(cf)); |
break; |
break; |
default: |
default: |
return (-1); |
break; |
} |
} |
|
} else { |
|
if (cf->cf_cvstat == CVS_FST_UNKNOWN) { |
|
cvs_printf("? %s\n", fpath); |
|
return (0); |
|
} |
|
|
cvs_ent_free(entp); |
snprintf(fpath, sizeof(fpath), "%s/%s/%s%s", |
return (0); |
root->cr_dir, repo, CVS_FILE_NAME(cf), RCS_FILE_EXT); |
} |
|
|
|
snprintf(fpath, sizeof(fpath), "%s/%s/%s%s", |
rf = rcs_open(fpath, RCS_MODE_READ); |
root->cr_dir, repo, CVS_FILE_NAME(cf), RCS_FILE_EXT); |
if (rf == NULL) { |
|
cvs_ent_free(entp); |
|
return (-1); |
|
} |
|
|
rf = rcs_open(fpath, RCS_MODE_READ); |
rcs_close(rf); |
if (rf == NULL) { |
|
cvs_ent_free(entp); |
|
return (-1); |
|
} |
} |
|
|
rcs_close(rf); |
if (entp != NULL) |
cvs_ent_free(entp); |
cvs_ent_free(entp); |
return (0); |
return (ret); |
} |
} |
|
|
#ifdef notyet |
#ifdef notyet |