version 1.2, 2004/12/14 22:30:48 |
version 1.3, 2005/01/14 18:02:04 |
|
|
{ |
{ |
int ch, flags; |
int ch, flags; |
struct cvsroot *root; |
struct cvsroot *root; |
char *tag, *old_tag; |
char *tag, *old_tag, *date; |
int branch, delete; |
int branch, delete; |
|
|
old_tag = NULL; |
date = old_tag = NULL; |
branch = delete = 0; |
branch = delete = 0; |
flags = CF_SORT|CF_IGNORE|CF_RECURSE; |
flags = CF_SORT|CF_IGNORE|CF_RECURSE; |
|
|
while ((ch = getopt(argc, argv, "bdlr:")) != -1) { |
while ((ch = getopt(argc, argv, "bdD:lr:")) != -1) { |
switch (ch) { |
switch (ch) { |
case 'b': |
case 'b': |
branch = 1; |
branch = 1; |
|
|
case 'd': |
case 'd': |
delete = 1; |
delete = 1; |
break; |
break; |
|
case 'D': |
|
date = optarg; |
|
break; |
case 'l': |
case 'l': |
flags &= ~CF_RECURSE; |
flags &= ~CF_RECURSE; |
break; |
break; |
|
|
if (delete && old_tag) |
if (delete && old_tag) |
old_tag = NULL; |
old_tag = NULL; |
|
|
|
if (delete && date) |
|
date = NULL; |
|
|
|
if (old_tag != NULL && date != NULL) { |
|
cvs_log(LP_ERROR, "-r and -D options are mutually exclusive"); |
|
return (-1); |
|
} |
|
|
if (argc == 0) |
if (argc == 0) |
cvs_files = cvs_file_get(".", flags); |
cvs_files = cvs_file_get(".", flags); |
else |
else |
|
|
if (delete && (cvs_sendarg(root, "-d", 0) < 0)) |
if (delete && (cvs_sendarg(root, "-d", 0) < 0)) |
return (EX_PROTOCOL); |
return (EX_PROTOCOL); |
if (old_tag) { |
if (old_tag) { |
cvs_sendarg(root, "-r", 0); |
if ((cvs_sendarg(root, "-r", 0) < 0) || |
cvs_sendarg(root, old_tag, 0); |
(cvs_sendarg(root, old_tag, 0) < 0)) |
|
return (EX_PROTOCOL); |
|
} |
|
if (date) { |
|
if ((cvs_sendarg(root, "-D", 0) < 0) || |
|
(cvs_sendarg(root, date, 0) < 0)) |
|
return (EX_PROTOCOL); |
} |
} |
if (cvs_sendarg(root, tag, 0) < 0) |
if (cvs_sendarg(root, tag, 0) < 0) |
return (EX_PROTOCOL); |
return (EX_PROTOCOL); |