version 1.67, 2006/03/27 21:56:32 |
version 1.68, 2006/03/29 08:44:08 |
|
|
} |
} |
|
|
if ((pipeout == 0) && (stat(dst, &st) == 0) && !(flags & FORCE)) { |
if ((pipeout == 0) && (stat(dst, &st) == 0) && !(flags & FORCE)) { |
if (verbose == 0) { |
/* |
cvs_log(LP_ERR, |
* XXX - Not sure what is "right". If we go according |
"writable %s exists; checkout aborted", |
* to GNU's behavior, an existing file with no writable |
dst); |
* bits is overwritten without prompting the user. |
return (-1); |
* |
} |
* This is dangerous, so we always prompt. |
|
* Unfortunately this interferes with an unlocked |
if (st.st_mode & S_IWUSR) |
* checkout followed by a locked checkout, which should |
|
* not prompt. One (unimplemented) solution is to check |
|
* if the existing file is the same as the checked out |
|
* revision, and prompt if there are differences. |
|
*/ |
|
if (st.st_mode & (S_IWUSR|S_IWGRP|S_IWOTH)) |
printf("writable "); |
printf("writable "); |
printf("%s exists%s; ", dst, |
printf("%s exists%s; ", dst, |
(getuid() == st.st_uid) ? "" : |
(getuid() == st.st_uid) ? "" : |
|
|
printf("remove it? [ny](n): "); |
printf("remove it? [ny](n): "); |
/* default is n */ |
/* default is n */ |
if (cvs_yesno() == -1) { |
if (cvs_yesno() == -1) { |
cvs_log(LP_ERR, "checkout aborted"); |
if ((verbose == 1) && isatty(STDIN_FILENO)) |
|
cvs_log(LP_ERR, |
|
"writable %s exists; checkout aborted", |
|
dst); |
|
else |
|
cvs_log(LP_ERR, "checkout aborted"); |
return (-1); |
return (-1); |
} |
} |
} |
} |