version 1.76, 2006/04/13 03:18:06 |
version 1.77, 2006/04/14 01:11:07 |
|
|
rcs_set_mtime(fpath, rcs_mtime); |
rcs_set_mtime(fpath, rcs_mtime); |
} |
} |
|
|
if ((rev != RCS_HEAD_REV) && (frev != NULL)) |
if (rev != RCS_HEAD_REV && frev != NULL) |
rcsnum_free(frev); |
rcsnum_free(frev); |
|
|
return (status); |
return (status); |
|
|
* If we cannot find one, we return an error. |
* If we cannot find one, we return an error. |
*/ |
*/ |
rdp = NULL; |
rdp = NULL; |
if ((file->rf_ndelta != 0) && (frev == file->rf_head)) { |
if (file->rf_ndelta != 0 && frev == file->rf_head) { |
if (lcount > 1) { |
if (lcount > 1) { |
cvs_log(LP_WARN, |
cvs_log(LP_WARN, |
"multiple revisions locked by %s; " |
"multiple revisions locked by %s; " |
|
|
continue; |
continue; |
} |
} |
|
|
if ((author != NULL) && |
if (author != NULL && |
(strcmp(rdp->rd_author, author))) |
strcmp(rdp->rd_author, author)) |
continue; |
continue; |
|
|
if ((state != NULL) && |
if (state != NULL && |
(strcmp(rdp->rd_state, state))) |
strcmp(rdp->rd_state, state)) |
continue; |
continue; |
|
|
frev = rdp->rd_num; |
frev = rdp->rd_num; |
|
|
rdp = rcs_findrev(file, frev); |
rdp = rcs_findrev(file, frev); |
} |
} |
|
|
if ((file->rf_ndelta != 0) && (rdp == NULL)) { |
if (file->rf_ndelta != 0 && rdp == NULL) { |
checkout_err_nobranch(file, author, date, state, flags); |
checkout_err_nobranch(file, author, date, state, flags); |
return (-1); |
return (-1); |
} |
} |
|
|
|
|
rcsnum_tostr(rev, buf, sizeof(buf)); |
rcsnum_tostr(rev, buf, sizeof(buf)); |
|
|
if ((file->rf_ndelta != 0) && (rdp->rd_locker != NULL)) { |
if (file->rf_ndelta != 0 && rdp->rd_locker != NULL) { |
if (strcmp(lockname, rdp->rd_locker)) { |
if (strcmp(lockname, rdp->rd_locker)) { |
strlcpy(msg, "Revision %s is already locked by %s; ", |
strlcpy(msg, "Revision %s is already locked by %s; ", |
sizeof(msg)); |
sizeof(msg)); |
|
|
} |
} |
} |
} |
|
|
if ((verbose == 1) && !(flags & NEWFILE) && |
if (verbose == 1 && !(flags & NEWFILE) && |
!(flags & CO_REVERT) && (file->rf_ndelta != 0)) |
!(flags & CO_REVERT) && file->rf_ndelta != 0) |
printf("revision %s", buf); |
printf("revision %s", buf); |
|
|
if ((verbose == 1) && (flags & CO_REVERT)) |
if (verbose == 1 && (flags & CO_REVERT)) |
printf("done"); |
printf("done"); |
|
|
if (file->rf_ndelta != 0) { |
if (file->rf_ndelta != 0) { |
|
|
|
|
if (flags & CO_LOCK) { |
if (flags & CO_LOCK) { |
if (file->rf_ndelta != 0) { |
if (file->rf_ndelta != 0) { |
if ((lockname != NULL) |
if (lockname != NULL && |
&& (rcs_lock_add(file, lockname, rev) < 0)) { |
rcs_lock_add(file, lockname, rev) < 0) { |
if (rcs_errno != RCS_ERR_DUPENT) |
if (rcs_errno != RCS_ERR_DUPENT) |
return (-1); |
return (-1); |
} |
} |
|
|
mode |= S_IWUSR; |
mode |= S_IWUSR; |
|
|
if (file->rf_ndelta != 0) { |
if (file->rf_ndelta != 0) { |
if ((verbose == 1) && !(flags & NEWFILE) |
if (verbose == 1 && !(flags & NEWFILE) && |
&& !(flags & CO_REVERT)) |
!(flags & CO_REVERT)) |
printf(" (locked)"); |
printf(" (locked)"); |
} |
} |
} else if (flags & CO_UNLOCK) { |
} else if (flags & CO_UNLOCK) { |
|
|
(S_IXUSR|S_IXGRP|S_IXOTH|S_IRUSR|S_IRGRP|S_IROTH); |
(S_IXUSR|S_IXGRP|S_IXOTH|S_IRUSR|S_IRGRP|S_IROTH); |
|
|
if (file->rf_ndelta != 0) { |
if (file->rf_ndelta != 0) { |
if ((verbose == 1) && !(flags & NEWFILE) |
if (verbose == 1 && !(flags & NEWFILE) && |
&& !(flags & CO_REVERT)) |
!(flags & CO_REVERT)) |
printf(" (unlocked)"); |
printf(" (unlocked)"); |
} |
} |
} |
} |
|
|
if ((file->rf_ndelta == 0) && |
if (file->rf_ndelta == 0 && |
((flags & CO_LOCK) || (flags & CO_UNLOCK))) { |
((flags & CO_LOCK) || (flags & CO_UNLOCK))) { |
cvs_log(LP_WARN, "no revisions, so nothing can be %s", |
cvs_log(LP_WARN, "no revisions, so nothing can be %s", |
(flags & CO_LOCK) ? "locked" : "unlocked"); |
(flags & CO_LOCK) ? "locked" : "unlocked"); |
} else if (file->rf_ndelta != 0) { |
} else if (file->rf_ndelta != 0) { |
if ((verbose == 1) && !(flags & NEWFILE)) |
if (verbose == 1 && !(flags & NEWFILE)) |
printf("\n"); |
printf("\n"); |
} |
} |
|
|
if (flags & CO_LOCK) { |
if (flags & CO_LOCK) { |
if (rcs_errno != RCS_ERR_DUPENT) |
if (rcs_errno != RCS_ERR_DUPENT) |
lcount++; |
lcount++; |
if ((verbose == 1) && (lcount > 1) && !(flags & CO_REVERT)) |
if (verbose == 1 && lcount > 1 && !(flags & CO_REVERT)) |
cvs_log(LP_WARN, "%s: warning: You now have %d locks.", |
cvs_log(LP_WARN, "%s: warning: You now have %d locks.", |
file->rf_path, lcount); |
file->rf_path, lcount); |
} |
} |
|
|
if ((pipeout == 0) && (stat(dst, &st) == 0) && !(flags & FORCE)) { |
if (pipeout == 0 && stat(dst, &st) == 0 && !(flags & FORCE)) { |
/* |
/* |
* XXX - Not sure what is "right". If we go according |
* XXX - Not sure what is "right". If we go according |
* to GNU's behavior, an existing file with no writable |
* to GNU's behavior, an existing file with no writable |
|
|
printf("remove it? [ny](n): "); |
printf("remove it? [ny](n): "); |
/* default is n */ |
/* default is n */ |
if (cvs_yesno() == -1) { |
if (cvs_yesno() == -1) { |
if ((verbose == 1) && isatty(STDIN_FILENO)) |
if (verbose == 1 && isatty(STDIN_FILENO)) |
cvs_log(LP_ERR, |
cvs_log(LP_ERR, |
"writable %s exists; checkout aborted", |
"writable %s exists; checkout aborted", |
dst); |
dst); |