version 1.40, 2006/03/27 15:26:11 |
version 1.41, 2006/04/01 00:56:54 |
|
|
sizeof(repodir)) >= sizeof(repodir)) |
sizeof(repodir)) >= sizeof(repodir)) |
fatal("cvs_import_pre_exec: cvs_path_cat overflow"); |
fatal("cvs_import_pre_exec: cvs_path_cat overflow"); |
|
|
if (mkdir(repodir, 0700) == -1) |
if (mkdir(repodir, 0775) == -1) |
fatal("cvs_import_pre_exec: mkdir `%s': %s", |
fatal("cvs_import_pre_exec: mkdir `%s': %s", |
repodir, strerror(errno)); |
repodir, strerror(errno)); |
} else { |
} else { |
|
|
struct stat fst; |
struct stat fst; |
struct timeval ts[2]; |
struct timeval ts[2]; |
struct cvsroot *root; |
struct cvsroot *root; |
|
struct rcs_delta *rdp; |
|
struct rcs_branch *brp; |
RCSFILE *rf; |
RCSFILE *rf; |
RCSNUM *rev; |
RCSNUM *rev, *brev; |
BUF *bp; |
BUF *bp; |
|
|
root = CVS_DIR_ROOT(cf); |
root = CVS_DIR_ROOT(cf); |
|
|
fatal("cvs_import_local: cvs_path_cat overflow"); |
fatal("cvs_import_local: cvs_path_cat overflow"); |
|
|
cvs_printf("Importing %s\n", rpath); |
cvs_printf("Importing %s\n", rpath); |
if (mkdir(rpath, 0700) == -1) { |
if (mkdir(rpath, 0755) == -1) { |
cvs_log(LP_ERRNO, "failed to create %s", |
cvs_log(LP_ERRNO, "failed to create %s", |
rpath); |
rpath); |
} |
} |
|
|
|
|
cvs_printf("N %s\n", fpath); |
cvs_printf("N %s\n", fpath); |
|
|
if ((rf = rcs_open(rpath, RCS_RDWR|RCS_CREATE)) == NULL) |
if ((rf = rcs_open(rpath, RCS_RDWR|RCS_CREATE, 0444)) == NULL) |
fatal("cvs_import_local: rcs_open: `%s': %s", rpath, |
fatal("cvs_import_local: rcs_open: `%s': %s", rpath, |
rcs_errstr(rcs_errno)); |
rcs_errstr(rcs_errno)); |
|
|
|
|
if (comment != NULL) |
if (comment != NULL) |
rcs_comment_set(rf, comment); |
rcs_comment_set(rf, comment); |
|
|
rev = rcsnum_brtorev(imp_brnum); |
brev = rcsnum_brtorev(imp_brnum); |
if (rcs_rev_add(rf, rev, cvs_msg, stamp, NULL) < 0) { |
if (rcs_rev_add(rf, brev, cvs_msg, stamp, NULL) < 0) { |
(void)unlink(rpath); |
(void)unlink(rpath); |
fatal("cvs_import_local: rcs_rev_add failed: %s", |
fatal("cvs_import_local: rcs_rev_add failed: %s", |
rcs_errstr(rcs_errno)); |
rcs_errstr(rcs_errno)); |
} |
} |
|
|
if (rcs_sym_add(rf, release, rev) < 0) { |
if (rcs_sym_add(rf, release, brev) < 0) { |
(void)unlink(rpath); |
(void)unlink(rpath); |
fatal("cvs_import_local: rcs_sym_add failed: %s", |
fatal("cvs_import_local: rcs_sym_add failed: %s", |
rcs_errstr(rcs_errno)); |
rcs_errstr(rcs_errno)); |
} |
} |
|
|
|
rev = rcsnum_alloc(); |
rcsnum_cpy(imp_brnum, rev, 2); |
rcsnum_cpy(imp_brnum, rev, 2); |
if (rcs_rev_add(rf, rev, cvs_msg, stamp, NULL) < 0) { |
if (rcs_rev_add(rf, rev, cvs_msg, stamp, NULL) < 0) { |
(void)unlink(rpath); |
(void)unlink(rpath); |
|
|
fatal("cvs_import_local: rcs_sym_add failed: %s", |
fatal("cvs_import_local: rcs_sym_add failed: %s", |
rcs_errstr(rcs_errno)); |
rcs_errstr(rcs_errno)); |
} |
} |
|
|
|
/* |
|
* Put the branch revision on the branches list for the first revision. |
|
*/ |
|
rdp = rcs_findrev(rf, rev); |
|
brp = (struct rcs_branch *)xmalloc(sizeof(*brp)); |
|
brp->rb_num = rcsnum_alloc(); |
|
rcsnum_cpy(brev, brp->rb_num, 0); |
|
TAILQ_INSERT_TAIL(&(rdp->rd_branches), brp, rb_list); |
|
|
if ((bp = cvs_buf_load(fpath, BUF_AUTOEXT)) == NULL) { |
if ((bp = cvs_buf_load(fpath, BUF_AUTOEXT)) == NULL) { |
(void)unlink(rpath); |
(void)unlink(rpath); |