version 1.110, 2010/11/11 21:00:59 |
version 1.111, 2015/01/16 06:40:06 |
|
|
void |
void |
cvs_add_remote(struct cvs_file *cf) |
cvs_add_remote(struct cvs_file *cf) |
{ |
{ |
char path[MAXPATHLEN]; |
char path[PATH_MAX]; |
|
|
cvs_log(LP_TRACE, "cvs_add_remote(%s)", cf->file_path); |
cvs_log(LP_TRACE, "cvs_add_remote(%s)", cf->file_path); |
|
|
cvs_file_classify(cf, cvs_directory_tag); |
cvs_file_classify(cf, cvs_directory_tag); |
|
|
if (cf->file_type == CVS_DIR) { |
if (cf->file_type == CVS_DIR) { |
cvs_get_repository_path(cf->file_wd, path, MAXPATHLEN); |
cvs_get_repository_path(cf->file_wd, path, PATH_MAX); |
if (strlcat(path, "/", sizeof(path)) >= sizeof(path)) |
if (strlcat(path, "/", sizeof(path)) >= sizeof(path)) |
fatal("cvs_add_remote: truncation"); |
fatal("cvs_add_remote: truncation"); |
if (strlcat(path, cf->file_path, sizeof(path)) >= sizeof(path)) |
if (strlcat(path, cf->file_path, sizeof(path)) >= sizeof(path)) |
|
|
cvs_add_loginfo(char *repo) |
cvs_add_loginfo(char *repo) |
{ |
{ |
BUF *buf; |
BUF *buf; |
char pwd[MAXPATHLEN]; |
char pwd[PATH_MAX]; |
|
|
if (getcwd(pwd, sizeof(pwd)) == NULL) |
if (getcwd(pwd, sizeof(pwd)) == NULL) |
fatal("Can't get working directory"); |
fatal("Can't get working directory"); |
|
|
cvs_add_tobranch(struct cvs_file *cf, char *tag) |
cvs_add_tobranch(struct cvs_file *cf, char *tag) |
{ |
{ |
BUF *bp; |
BUF *bp; |
char attic[MAXPATHLEN], repo[MAXPATHLEN]; |
char attic[PATH_MAX], repo[PATH_MAX]; |
char *msg; |
char *msg; |
struct stat st; |
struct stat st; |
RCSNUM *branch; |
RCSNUM *branch; |
|
|
if (fstat(cf->fd, &st) == -1) |
if (fstat(cf->fd, &st) == -1) |
fatal("cvs_add_tobranch: %s", strerror(errno)); |
fatal("cvs_add_tobranch: %s", strerror(errno)); |
|
|
cvs_get_repository_path(cf->file_wd, repo, MAXPATHLEN); |
cvs_get_repository_path(cf->file_wd, repo, PATH_MAX); |
(void)xsnprintf(attic, MAXPATHLEN, "%s/%s", |
(void)xsnprintf(attic, PATH_MAX, "%s/%s", |
repo, CVS_PATH_ATTIC); |
repo, CVS_PATH_ATTIC); |
|
|
if (mkdir(attic, 0755) == -1 && errno != EEXIST) |
if (mkdir(attic, 0755) == -1 && errno != EEXIST) |
fatal("cvs_add_tobranch: failed to create Attic"); |
fatal("cvs_add_tobranch: failed to create Attic"); |
|
|
(void)xsnprintf(attic, MAXPATHLEN, "%s/%s/%s%s", repo, |
(void)xsnprintf(attic, PATH_MAX, "%s/%s/%s%s", repo, |
CVS_PATH_ATTIC, cf->file_name, RCS_FILE_EXT); |
CVS_PATH_ATTIC, cf->file_name, RCS_FILE_EXT); |
|
|
xfree(cf->file_rpath); |
xfree(cf->file_rpath); |
|
|
int added, nb; |
int added, nb; |
struct stat st; |
struct stat st; |
CVSENTRIES *entlist; |
CVSENTRIES *entlist; |
char *date, entry[MAXPATHLEN], msg[1024], repo[MAXPATHLEN], *tag, *p; |
char *date, entry[PATH_MAX], msg[1024], repo[PATH_MAX], *tag, *p; |
struct file_info_list files_info; |
struct file_info_list files_info; |
struct file_info *fi; |
struct file_info *fi; |
struct trigger_list *line_list; |
struct trigger_list *line_list; |
|
|
cvs_log(LP_TRACE, "add_directory(%s)", cf->file_path); |
cvs_log(LP_TRACE, "add_directory(%s)", cf->file_path); |
|
|
(void)xsnprintf(entry, MAXPATHLEN, "%s%s", |
(void)xsnprintf(entry, PATH_MAX, "%s%s", |
cf->file_rpath, RCS_FILE_EXT); |
cf->file_rpath, RCS_FILE_EXT); |
|
|
added = 1; |
added = 1; |
|
|
/* Let's see if we have any per-directory tags first. */ |
/* Let's see if we have any per-directory tags first. */ |
cvs_parse_tagfile(cf->file_wd, &tag, &date, &nb); |
cvs_parse_tagfile(cf->file_wd, &tag, &date, &nb); |
|
|
(void)xsnprintf(entry, MAXPATHLEN, "%s/%s", |
(void)xsnprintf(entry, PATH_MAX, "%s/%s", |
cf->file_path, CVS_PATH_CVSDIR); |
cf->file_path, CVS_PATH_CVSDIR); |
|
|
if (cvs_server_active) { |
if (cvs_server_active) { |
|
|
strerror(errno)); |
strerror(errno)); |
|
|
cvs_get_repository_name(cf->file_wd, repo, |
cvs_get_repository_name(cf->file_wd, repo, |
MAXPATHLEN); |
PATH_MAX); |
|
|
(void)xsnprintf(entry, MAXPATHLEN, "%s/%s", |
(void)xsnprintf(entry, PATH_MAX, "%s/%s", |
repo, cf->file_name); |
repo, cf->file_name); |
|
|
cvs_mkadmin(cf->file_path, current_cvsroot->cr_dir, |
cvs_mkadmin(cf->file_path, current_cvsroot->cr_dir, |
|
|
if (date != NULL) |
if (date != NULL) |
xfree(date); |
xfree(date); |
|
|
cvs_get_repository_name(cf->file_path, repo, MAXPATHLEN); |
cvs_get_repository_name(cf->file_path, repo, PATH_MAX); |
line_list = cvs_trigger_getlines(CVS_PATH_LOGINFO, repo); |
line_list = cvs_trigger_getlines(CVS_PATH_LOGINFO, repo); |
if (line_list != NULL) { |
if (line_list != NULL) { |
TAILQ_INIT(&files_info); |
TAILQ_INIT(&files_info); |
|
|
add_entry(struct cvs_file *cf) |
add_entry(struct cvs_file *cf) |
{ |
{ |
FILE *fp; |
FILE *fp; |
char *entry, path[MAXPATHLEN]; |
char *entry, path[PATH_MAX]; |
char revbuf[CVS_REV_BUFSZ], tbuf[CVS_TIME_BUFSZ]; |
char revbuf[CVS_REV_BUFSZ], tbuf[CVS_TIME_BUFSZ]; |
char sticky[CVS_ENT_MAXLINELEN]; |
char sticky[CVS_ENT_MAXLINELEN]; |
CVSENTRIES *entlist; |
CVSENTRIES *entlist; |
|
|
0, 0, entry, CVS_ENT_MAXLINELEN); |
0, 0, entry, CVS_ENT_MAXLINELEN); |
} else { |
} else { |
if (logmsg != NULL) { |
if (logmsg != NULL) { |
(void)xsnprintf(path, MAXPATHLEN, "%s/%s/%s%s", |
(void)xsnprintf(path, PATH_MAX, "%s/%s/%s%s", |
cf->file_wd, CVS_PATH_CVSDIR, cf->file_name, |
cf->file_wd, CVS_PATH_CVSDIR, cf->file_name, |
CVS_DESCR_FILE_EXT); |
CVS_DESCR_FILE_EXT); |
|
|