version 1.83, 2007/11/11 09:51:49 |
version 1.84, 2008/01/10 09:41:52 |
|
|
cf->file_ent->ce_opts : "", sticky); |
cf->file_ent->ce_opts : "", sticky); |
} |
} |
|
|
|
if (cvs_cmdop == CVS_OP_ADD) |
|
cf->file_status = FILE_MODIFIED; |
|
|
switch (cf->file_status) { |
switch (cf->file_status) { |
case FILE_UNKNOWN: |
case FILE_UNKNOWN: |
if (cf->fd != -1) |
if (cf->fd != -1) |
|
|
{ |
{ |
CVSENTRIES *entlist; |
CVSENTRIES *entlist; |
struct cvs_ent *ent, *newent; |
struct cvs_ent *ent, *newent; |
|
size_t len; |
char *dir, *e, entry[CVS_ENT_MAXLINELEN], rev[CVS_REV_BUFSZ]; |
char *dir, *e, entry[CVS_ENT_MAXLINELEN], rev[CVS_REV_BUFSZ]; |
char sticky[CVS_ENT_MAXLINELEN], timebuf[CVS_TIME_BUFSZ]; |
char sticky[CVS_ENT_MAXLINELEN], timebuf[CVS_TIME_BUFSZ]; |
|
|
|
|
xfree(e); |
xfree(e); |
|
|
rcsnum_tostr(newent->ce_rev, rev, sizeof(rev)); |
rcsnum_tostr(newent->ce_rev, rev, sizeof(rev)); |
ctime_r(&ent->ce_mtime, timebuf); |
|
if (timebuf[strlen(timebuf) - 1] == '\n') |
|
timebuf[strlen(timebuf) - 1] = '\0'; |
|
|
|
sticky[0] = '\0'; |
sticky[0] = '\0'; |
if (ent->ce_tag != NULL) |
if (ent == NULL) { |
(void)xsnprintf(sticky, sizeof(sticky), "T%s", ent->ce_tag); |
len = strlcpy(rev, "0", sizeof(rev)); |
|
if (len >= sizeof(rev)) |
|
fatal("cvs_client_sendfile: truncation"); |
|
|
|
len = strlcpy(timebuf, "Initial ", sizeof(timebuf)); |
|
if (len >= sizeof(timebuf)) |
|
fatal("cvs_client_sendfile: truncation"); |
|
|
|
len = strlcat(timebuf, newent->ce_name, sizeof(timebuf)); |
|
if (len >= sizeof(timebuf)) |
|
fatal("cvs_client_sendfile: truncation"); |
|
} else { |
|
ctime_r(&ent->ce_mtime, timebuf); |
|
timebuf[strcspn(timebuf, "\n")] = '\0'; |
|
|
|
if (newent->ce_tag != NULL) |
|
(void)xsnprintf(sticky, sizeof(sticky), "T%s", |
|
ent->ce_tag); |
|
newent->ce_opts = ent->ce_opts; |
|
|
|
cvs_ent_free(ent); |
|
} |
|
|
(void)xsnprintf(entry, CVS_ENT_MAXLINELEN, "/%s/%s%s/%s/%s/%s", |
(void)xsnprintf(entry, CVS_ENT_MAXLINELEN, "/%s/%s%s/%s/%s/%s", |
newent->ce_name, (newent->ce_status == CVS_ENT_REMOVED) ? "-" : "", |
newent->ce_name, (newent->ce_status == CVS_ENT_REMOVED) ? "-" : "", |
rev, timebuf, ent->ce_opts ? ent->ce_opts : "", sticky); |
rev, timebuf, newent->ce_opts ? newent->ce_opts : "", sticky); |
|
|
cvs_ent_free(ent); |
|
cvs_ent_free(newent); |
cvs_ent_free(newent); |
cvs_ent_add(entlist, entry); |
cvs_ent_add(entlist, entry); |
cvs_ent_close(entlist, ENT_SYNC); |
cvs_ent_close(entlist, ENT_SYNC); |