version 1.88, 2007/01/28 23:39:42 |
version 1.89, 2007/01/31 21:07:35 |
|
|
void |
void |
cvs_checkout_file(struct cvs_file *cf, RCSNUM *rnum, int co_flags) |
cvs_checkout_file(struct cvs_file *cf, RCSNUM *rnum, int co_flags) |
{ |
{ |
int kflag, l, oflags, exists; |
int kflag, oflags, exists; |
time_t rcstime; |
time_t rcstime; |
CVSENTRIES *ent; |
CVSENTRIES *ent; |
struct timeval tv[2]; |
struct timeval tv[2]; |
|
|
tbuf[strlen(tbuf) - 1] = '\0'; |
tbuf[strlen(tbuf) - 1] = '\0'; |
|
|
if (co_flags & CO_MERGE) { |
if (co_flags & CO_MERGE) { |
l = snprintf(timebuf, sizeof(timebuf), "Result of merge+%s", |
(void)xsnprintf(timebuf, sizeof(timebuf), "Result of merge+%s", |
tbuf); |
tbuf); |
if (l == -1 || l >= (int)sizeof(timebuf)) |
|
fatal("cvs_checkout_file: overflow"); |
|
} else { |
} else { |
strlcpy(timebuf, tbuf, sizeof(timebuf)); |
strlcpy(timebuf, tbuf, sizeof(timebuf)); |
} |
} |
|
|
if (co_flags & CO_SETSTICKY) { |
if (co_flags & CO_SETSTICKY) |
l = snprintf(stickytag, sizeof(stickytag), "T%s", rev); |
(void)xsnprintf(stickytag, sizeof(stickytag), "T%s", rev); |
if (l == -1 || l >= (int)sizeof(stickytag)) |
else |
fatal("cvs_checkout_file: overflow"); |
|
} else { |
|
stickytag[0] = '\0'; |
stickytag[0] = '\0'; |
} |
|
|
|
kbuf[0] = '\0'; |
kbuf[0] = '\0'; |
if (cf->file_ent != NULL) { |
if (cf->file_ent != NULL) { |
|
|
} else if (cf->file_rcs->rf_expand != NULL) { |
} else if (cf->file_rcs->rf_expand != NULL) { |
kflag = rcs_kflag_get(cf->file_rcs->rf_expand); |
kflag = rcs_kflag_get(cf->file_rcs->rf_expand); |
if (!(kflag & RCS_KWEXP_DEFAULT)) |
if (!(kflag & RCS_KWEXP_DEFAULT)) |
snprintf(kbuf, sizeof(kbuf), |
(void)xsnprintf(kbuf, sizeof(kbuf), |
"-k%s", cf->file_rcs->rf_expand); |
"-k%s", cf->file_rcs->rf_expand); |
} |
} |
|
|
l = snprintf(entry, CVS_ENT_MAXLINELEN, "/%s/%s/%s/%s/%s", |
(void)xsnprintf(entry, CVS_ENT_MAXLINELEN, "/%s/%s/%s/%s/%s", |
cf->file_name, rev, timebuf, kbuf, stickytag); |
cf->file_name, rev, timebuf, kbuf, stickytag); |
|
|
if (cvs_server_active == 0) { |
if (cvs_server_active == 0) { |
|
|
|
|
if (!(co_flags & CO_COMMIT)) { |
if (!(co_flags & CO_COMMIT)) { |
if (!(co_flags & CO_MERGE)) { |
if (!(co_flags & CO_MERGE)) { |
l = snprintf(template, MAXPATHLEN, |
(void)xsnprintf(template, MAXPATHLEN, |
"%s/checkout.XXXXXXXXXX", cvs_tmpdir); |
"%s/checkout.XXXXXXXXXX", cvs_tmpdir); |
if (l == -1 || l >= MAXPATHLEN) |
|
fatal("cvs_Checkout_file: overflow"); |
|
rcs_rev_write_stmp(cf->file_rcs, rnum, |
rcs_rev_write_stmp(cf->file_rcs, rnum, |
template, 0); |
template, 0); |
tosend = template; |
tosend = template; |