Lines Matching refs:cf

228 cvs_import_local(struct cvs_file *cf)
234 cvs_log(LP_TRACE, "cvs_import_local(%s)", cf->file_path);
236 cvs_file_classify(cf, cvs_directory_tag);
238 if (cf->file_type == CVS_DIR) {
239 if (!strcmp(cf->file_path, "."))
243 cvs_log(LP_NOTICE, "Importing %s", cf->file_path);
248 if (mkdir(cf->file_rpath, 0755) == -1 && errno != EEXIST)
249 fatal("cvs_import_local: %s: %s", cf->file_rpath,
257 current_cvsroot->cr_dir, cf->file_wd, CVS_PATH_ATTIC,
258 cf->file_name, RCS_FILE_EXT);
260 if (cf->file_rcs != NULL || stat(repo, &st) != -1)
264 import_new(cf);
266 import_update(cf);
304 import_new(struct cvs_file *cf)
317 cvs_log(LP_TRACE, "import_new(%s)", cf->file_name);
320 import_printf("N %s/%s\n", import_repository, cf->file_path);
324 if (fstat(cf->fd, &st) == -1)
335 bp = buf_load_fd(cf->fd);
340 cf->repo_fd = open(cf->file_rpath, O_CREAT | O_RDONLY);
341 if (cf->repo_fd == -1)
342 fatal("import_new: %s: %s", cf->file_rpath, strerror(errno));
344 cf->file_rcs = rcs_open(cf->file_rpath, cf->repo_fd, RCS_CREATE,
346 if (cf->file_rcs == NULL)
348 cf->file_path);
350 rcs_branch_set(cf->file_rcs, branch);
352 if (rcs_sym_add(cf->file_rcs, vendor_tag, branch) == -1)
356 if (rcs_sym_add(cf->file_rcs, release_tags[i], brev) == -1)
360 if (rcs_rev_add(cf->file_rcs, brev, logmsg, tstamp, NULL) == -1)
363 if (rcs_rev_add(cf->file_rcs, RCS_HEAD_REV, "Initial revision",
367 if ((rdp = rcs_findrev(cf->file_rcs, cf->file_rcs->rf_head)) == NULL)
375 if (rcs_deltatext_set(cf->file_rcs,
376 cf->file_rcs->rf_head, bp) == -1)
380 rcs_kwexp_set(cf->file_rcs, kflag);
382 rcs_write(cf->file_rcs);
383 import_printf("N %s/%s\n", import_repository, cf->file_path);
390 import_update(struct cvs_file *cf)
397 cvs_log(LP_TRACE, "import_update(%s)", cf->file_path);
399 if (cf->file_rcs->rf_head == NULL)
400 fatal("no head revision in RCS file for `%s'", cf->file_path);
402 if ((rev = rcs_translate_tag(import_branch, cf->file_rcs)) == NULL)
409 b1 = rcs_rev_getbuf(cf->file_rcs, rev, RCS_KWEXP_NONE);
410 b2 = buf_load_fd(cf->fd);
416 import_tag(cf, brev, rev);
419 rcs_write(cf->file_rcs);
420 import_printf("U %s/%s\n", import_repository, cf->file_path);
424 if (cf->file_rcs->rf_branch != NULL)
425 rcsnum_tostr(cf->file_rcs->rf_branch, branch, sizeof(branch));
427 if (cf->file_rcs->rf_branch == NULL || cf->in_attic == 1 ||
430 import_printf("C %s/%s\n", import_repository, cf->file_path);
432 import_printf("U %s/%s\n", import_repository, cf->file_path);
438 d = import_get_rcsdiff(cf, rev);
441 if (rcs_rev_add(cf->file_rcs, newrev, logmsg, -1, NULL) == -1)
444 if (rcs_deltatext_set(cf->file_rcs, newrev, d) == -1)
447 import_tag(cf, brev, newrev);
450 rcs_kwexp_set(cf->file_rcs, kflag);
453 rcs_write(cf->file_rcs);
457 import_tag(struct cvs_file *cf, RCSNUM *branch, RCSNUM *newrev)
462 rcs_sym_add(cf->file_rcs, vendor_tag, branch);
465 rcs_sym_add(cf->file_rcs, release_tags[i], newrev);
470 import_get_rcsdiff(struct cvs_file *cf, RCSNUM *rev)
478 b1 = buf_load_fd(cf->fd);
485 fd2 = rcs_rev_write_stmp(cf->file_rcs, rev, p2, RCS_KWEXP_NONE);