version 1.19, 2005/04/18 21:02:50 |
version 1.20, 2005/04/27 04:54:46 |
|
|
}; |
}; |
|
|
|
|
int cvs_status_file (CVSFILE *, void *); |
int cvs_status_remote (CVSFILE *, void *); |
int cvs_status_local (CVSFILE *, void *); |
int cvs_status_local (CVSFILE *, void *); |
int cvs_status_options (char *, int, char **, int *); |
int cvs_status_options (char *, int, char **, int *); |
int cvs_status_sendflags (struct cvsroot *); |
int cvs_status_sendflags (struct cvsroot *); |
|
|
struct cvs_cmd_info cvs_status = { |
struct cvs_cmd_info cvs_status = { |
cvs_status_options, |
cvs_status_options, |
cvs_status_sendflags, |
cvs_status_sendflags, |
cvs_status_file, |
cvs_status_remote, |
NULL, NULL, |
NULL, NULL, |
CF_SORT | CF_IGNORE | CF_RECURSE, |
CF_SORT | CF_IGNORE | CF_RECURSE, |
CVS_REQ_STATUS, |
CVS_REQ_STATUS, |
|
|
} |
} |
|
|
/* |
/* |
* cvs_status_file() |
* cvs_status_remote() |
* |
* |
* Get the status of a single file. |
* Get the status of a single file. |
*/ |
*/ |
int |
int |
cvs_status_file(CVSFILE *cfp, void *arg) |
cvs_status_remote(CVSFILE *cfp, void *arg) |
{ |
{ |
int ret; |
int ret; |
char *repo, fpath[MAXPATHLEN]; |
char *repo, fpath[MAXPATHLEN]; |
|
|
|
|
switch (cfp->cf_cvstat) { |
switch (cfp->cf_cvstat) { |
case CVS_FST_UNKNOWN: |
case CVS_FST_UNKNOWN: |
ret = cvs_sendreq(root, CVS_REQ_QUESTIONABLE, |
ret = cvs_sendreq(root, CVS_REQ_QUESTIONABLE, cfp->cf_name); |
CVS_FILE_NAME(cfp)); |
|
break; |
break; |
case CVS_FST_UPTODATE: |
case CVS_FST_UPTODATE: |
ret = cvs_sendreq(root, CVS_REQ_UNCHANGED, |
ret = cvs_sendreq(root, CVS_REQ_UNCHANGED, cfp->cf_name); |
CVS_FILE_NAME(cfp)); |
|
break; |
break; |
case CVS_FST_ADDED: |
case CVS_FST_ADDED: |
case CVS_FST_MODIFIED: |
case CVS_FST_MODIFIED: |
ret = cvs_sendreq(root, CVS_REQ_MODIFIED, |
ret = cvs_sendreq(root, CVS_REQ_MODIFIED, cfp->cf_name); |
CVS_FILE_NAME(cfp)); |
|
if (ret == 0) |
if (ret == 0) |
ret = cvs_sendfile(root, fpath); |
ret = cvs_sendfile(root, fpath); |
default: |
default: |
|
|
int l; |
int l; |
char *repo, buf[MAXNAMLEN], fpath[MAXPATHLEN], rcspath[MAXPATHLEN]; |
char *repo, buf[MAXNAMLEN], fpath[MAXPATHLEN], rcspath[MAXPATHLEN]; |
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) |
|
|
repo = CVS_DIR_REPO(cfp); |
repo = CVS_DIR_REPO(cfp); |
|
|
cvs_file_getpath(cfp, fpath, sizeof(fpath)); |
cvs_file_getpath(cfp, fpath, sizeof(fpath)); |
entp = cvs_ent_getent(fpath); |
|
|
|
if (cfp->cf_cvstat == CVS_FST_UNKNOWN) { |
if (cfp->cf_cvstat == CVS_FST_UNKNOWN) { |
cvs_log(LP_WARN, "I know nothing about %s", fpath); |
cvs_log(LP_WARN, "I know nothing about %s", fpath); |
|
|
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) { |
if (entp != NULL) |
|
cvs_ent_free(entp); |
|
return (-1); |
return (-1); |
} |
} |
|
|
|
|
cvs_printf(CVS_STATUS_SEP "\nFile: %-18sStatus: %s\n\n", |
cvs_printf(CVS_STATUS_SEP "\nFile: %-18sStatus: %s\n\n", |
buf, cvs_statstr[cfp->cf_cvstat]); |
buf, cvs_statstr[cfp->cf_cvstat]); |
|
|
if (entp == NULL) { |
if (cfp->cf_cvstat == CVS_FST_UNKNOWN) { |
snprintf(buf, sizeof(buf), "No entry for %s", |
snprintf(buf, sizeof(buf), "No entry for %s", |
CVS_FILE_NAME(cfp)); |
CVS_FILE_NAME(cfp)); |
} else { |
} else { |
snprintf(buf, sizeof(buf), "%s %s", |
snprintf(buf, sizeof(buf), "%s %s", |
rcsnum_tostr(entp->ce_rev, buf, sizeof(buf)), |
rcsnum_tostr(cfp->cf_lrev, buf, sizeof(buf)), |
"date here"); |
"date here"); |
} |
} |
|
|
|
|
|
|
rcs_close(rf); |
rcs_close(rf); |
|
|
if (entp != NULL) |
|
cvs_ent_free(entp); |
|
return (0); |
return (0); |
} |
} |