version 1.7, 2004/08/12 18:37:27 |
version 1.8, 2004/11/26 16:23:50 |
|
|
|
|
extern int cvs_client; |
extern int cvs_client; |
|
|
static int aflag, bflag, dflag, iflag, tflag, Tflag, wflag; |
static int aflag, bflag, dflag, iflag, Nflag, tflag, Tflag, wflag; |
static int context, status; |
static int context, status; |
static int format = D_NORMAL; |
static int format = D_NORMAL; |
static struct stat stb1, stb2; |
static struct stat stb1, stb2; |
|
|
memset(&darg, 0, sizeof(darg)); |
memset(&darg, 0, sizeof(darg)); |
strlcpy(diffargs, argv[0], sizeof(diffargs)); |
strlcpy(diffargs, argv[0], sizeof(diffargs)); |
|
|
while ((ch = getopt(argc, argv, "cD:lir:u")) != -1) { |
while ((ch = getopt(argc, argv, "cD:liN:r:u")) != -1) { |
switch (ch) { |
switch (ch) { |
case 'c': |
case 'c': |
strlcat(diffargs, " -c", sizeof(diffargs)); |
strlcat(diffargs, " -c", sizeof(diffargs)); |
|
|
strlcat(diffargs, " -i", sizeof(diffargs)); |
strlcat(diffargs, " -i", sizeof(diffargs)); |
iflag = 1; |
iflag = 1; |
break; |
break; |
|
case 'N': |
|
strlcat(diffargs, " -N", sizeof(diffargs)); |
|
Nflag = 1; |
|
break; |
case 'r': |
case 'r': |
if ((darg.rev1 == NULL) && (darg.date1 == NULL)) |
if ((darg.rev1 == NULL) && (darg.date1 == NULL)) |
darg.rev1 = optarg; |
darg.rev1 = optarg; |
|
|
int |
int |
cvs_diff_file(struct cvs_file *cfp, void *arg) |
cvs_diff_file(struct cvs_file *cfp, void *arg) |
{ |
{ |
char *dir, *repo, rcspath[MAXPATHLEN], buf[64]; |
char *dir, *repo, buf[64]; |
|
char fpath[MAXPATHLEN], dfpath[MAXPATHLEN], rcspath[MAXPATHLEN]; |
BUF *b1, *b2; |
BUF *b1, *b2; |
RCSNUM *r1, *r2; |
RCSNUM *r1, *r2; |
RCSFILE *rf; |
RCSFILE *rf; |
|
|
if (cfp->cf_type == DT_DIR) { |
if (cfp->cf_type == DT_DIR) { |
if (cfp->cf_cvstat == CVS_FST_UNKNOWN) { |
if (cfp->cf_cvstat == CVS_FST_UNKNOWN) { |
root = cfp->cf_parent->cf_ddat->cd_root; |
root = cfp->cf_parent->cf_ddat->cd_root; |
cvs_sendreq(root, CVS_REQ_QUESTIONABLE, cfp->cf_name); |
cvs_sendreq(root, CVS_REQ_QUESTIONABLE, |
|
CVS_FILE_NAME(cfp)); |
} |
} |
else { |
else { |
root = cfp->cf_ddat->cd_root; |
root = cfp->cf_ddat->cd_root; |
|
|
} |
} |
|
|
rf = NULL; |
rf = NULL; |
diff_file = cfp->cf_path; |
diff_file = cvs_file_getpath(cfp, fpath, sizeof(fpath)); |
|
|
if (cfp->cf_parent != NULL) { |
if (cfp->cf_parent != NULL) { |
dir = cfp->cf_parent->cf_path; |
dir = cvs_file_getpath(cfp->cf_parent, dfpath, sizeof(dfpath)); |
root = cfp->cf_parent->cf_ddat->cd_root; |
root = cfp->cf_parent->cf_ddat->cd_root; |
repo = cfp->cf_parent->cf_ddat->cd_repo; |
repo = cfp->cf_parent->cf_ddat->cd_repo; |
} |
} |
|
|
if (root->cr_method == CVS_METHOD_LOCAL) |
if (root->cr_method == CVS_METHOD_LOCAL) |
cvs_log(LP_WARN, "I know nothing about %s", diff_file); |
cvs_log(LP_WARN, "I know nothing about %s", diff_file); |
else |
else |
cvs_sendreq(root, CVS_REQ_QUESTIONABLE, cfp->cf_name); |
cvs_sendreq(root, CVS_REQ_QUESTIONABLE, |
|
CVS_FILE_NAME(cfp)); |
return (0); |
return (0); |
} |
} |
|
|
|
|
|
|
if (cfp->cf_cvstat == CVS_FST_UPTODATE) { |
if (cfp->cf_cvstat == CVS_FST_UPTODATE) { |
if (root->cr_method != CVS_METHOD_LOCAL) |
if (root->cr_method != CVS_METHOD_LOCAL) |
cvs_sendreq(root, CVS_REQ_UNCHANGED, cfp->cf_name); |
cvs_sendreq(root, CVS_REQ_UNCHANGED, |
|
CVS_FILE_NAME(cfp)); |
cvs_ent_free(entp); |
cvs_ent_free(entp); |
return (0); |
return (0); |
} |
} |
|
|
/* at this point, the file is modified */ |
/* at this point, the file is modified */ |
if (root->cr_method != CVS_METHOD_LOCAL) { |
if (root->cr_method != CVS_METHOD_LOCAL) { |
cvs_sendreq(root, CVS_REQ_MODIFIED, cfp->cf_name); |
cvs_sendreq(root, CVS_REQ_MODIFIED, CVS_FILE_NAME(cfp)); |
cvs_sendfile(root, diff_file); |
cvs_sendfile(root, diff_file); |
} |
} |
else { |
else { |