Lines Matching refs:cf

194 cvs_update_enterdir(struct cvs_file *cf)
199 cvs_log(LP_TRACE, "cvs_update_enterdir(%s)", cf->file_path);
201 cvs_file_classify(cf, NULL);
203 if (cf->file_status == DIR_CREATE && build_dirs == 1) {
204 cvs_parse_tagfile(cf->file_wd, &dirtag, NULL, NULL);
205 cvs_mkpath(cf->file_path, cvs_specified_tag != NULL ?
209 if ((cf->fd = open(cf->file_path, O_RDONLY)) == -1)
211 cf->file_path, strerror(errno));
214 cvs_server_clear_sticky(cf->file_path);
217 (void)xasprintf(&entry, "D/%s////", cf->file_name);
219 entlist = cvs_ent_open(cf->file_wd);
223 } else if ((cf->file_status == DIR_CREATE && build_dirs == 0) ||
224 cf->file_status == FILE_UNKNOWN) {
225 cf->file_status = FILE_SKIP;
228 cf->file_path, CVS_PATH_TAG);
232 cvs_write_tagfile(cf->file_path,
238 cvs_update_leavedir(struct cvs_file *cf)
248 cvs_log(LP_TRACE, "cvs_update_leavedir(%s)", cf->file_path);
250 if (cvs_server_active == 1 && !strcmp(cf->file_name, "."))
253 entlist = cvs_ent_open(cf->file_path);
259 if (fstat(cf->fd, &st) == -1)
264 cf->file_name);
271 if (lseek(cf->fd, 0, SEEK_SET) == -1)
274 while ((nbytes = getdents(cf->fd, buf, bufsize)) > 0) {
306 cvs_rmdir(cf->file_path);
309 entlist = cvs_ent_open(cf->file_wd);
310 cvs_ent_remove(entlist, cf->file_name);
316 cvs_update_local(struct cvs_file *cf)
322 cvs_log(LP_TRACE, "cvs_update_local(%s)", cf->file_path);
324 if (cf->file_type == CVS_DIR) {
325 if (cf->file_status == FILE_SKIP) {
327 cvs_printf("? %s\n", cf->file_path);
331 if (cf->file_status != FILE_UNKNOWN &&
333 cvs_log(LP_ERR, "Updating %s", cf->file_path);
343 cvs_file_classify(cf, tag);
345 if (kflag && cf->file_rcs != NULL)
346 rcs_kwexp_set(cf->file_rcs, kflag);
348 if ((cf->file_status == FILE_UPTODATE ||
349 cf->file_status == FILE_MODIFIED) && cf->file_ent != NULL &&
350 cf->file_ent->ce_tag != NULL && reset_tag) {
351 if (cf->file_status == FILE_MODIFIED)
352 cf->file_status = FILE_MERGE;
354 cf->file_status = FILE_CHECKOUT;
356 if ((cf->file_rcsrev = rcs_head_get(cf->file_rcs)) == NULL)
358 cf->file_path);
362 cvs_server_clear_sticky(cf->file_wd);
366 if (cf->file_status != FILE_UNKNOWN && cf->file_rcs != NULL &&
367 cf->file_rcsrev != NULL && !cf->file_rcs->rf_dead &&
368 (cf->file_flags & FILE_HAS_TAG)) {
369 rcsnum_tostr(cf->file_rcsrev, rbuf, sizeof(rbuf));
373 cf->file_path);
374 cvs_log(LP_RCS, "RCS: %s", cf->file_rpath);
378 cvs_checkout_file(cf, cf->file_rcsrev, tag, CO_DUMP);
383 if (cf->file_ent != NULL) {
384 if (cf->file_ent->ce_opts == NULL) {
386 cf->file_status = FILE_CHECKOUT;
387 } else if (cf->file_rcs != NULL) {
388 if (strlen(cf->file_ent->ce_opts) < 3)
390 cf->file_path);
392 ent_kflag = rcs_kflag_get(cf->file_ent->ce_opts + 2);
393 rcs_kflag = rcs_kwexp_get(cf->file_rcs);
397 cf->file_status = FILE_CHECKOUT;
401 switch (cf->file_status) {
403 cvs_printf("? %s\n", cf->file_path);
407 cvs_backup_file(cf);
409 cvs_checkout_file(cf, cf->file_rcsrev, NULL, flags);
410 cvs_printf("U %s\n", cf->file_path);
412 ret = update_has_conflict_markers(cf);
413 if (cf->file_ent->ce_conflict != NULL && ret == 1)
414 cvs_printf("C %s\n", cf->file_path);
416 if (cf->file_ent->ce_conflict != NULL && ret == 0)
417 update_clear_conflict(cf);
418 cvs_printf("M %s\n", cf->file_path);
423 cvs_printf("A %s\n", cf->file_path);
426 cvs_printf("R %s\n", cf->file_path);
429 cvs_printf("C %s\n", cf->file_path);
435 cvs_directory_date != -1 || (cf->file_ent != NULL &&
436 cf->file_ent->ce_tag != NULL)))
439 if (cf->file_flags & FILE_ON_DISK && (cf->file_ent == NULL ||
440 cf->file_ent->ce_type == CVS_ENT_NONE)) {
442 cf->file_path);
443 cvs_printf("C %s\n", cf->file_path);
445 cvs_checkout_file(cf, cf->file_rcsrev, tag, flags);
446 cvs_printf("U %s\n", cf->file_path);
447 cvs_history_add(CVS_HISTORY_UPDATE_CO, cf, NULL);
451 d3rev1 = cf->file_ent->ce_rev;
452 d3rev2 = cf->file_rcsrev;
453 cvs_checkout_file(cf, cf->file_rcsrev, tag, CO_MERGE);
456 cvs_printf("C %s\n", cf->file_path);
458 cf, NULL);
460 update_clear_conflict(cf);
461 cvs_printf("M %s\n", cf->file_path);
462 cvs_history_add(CVS_HISTORY_UPDATE_MERGED, cf, NULL);
466 (void)unlink(cf->file_path);
468 entlist = cvs_ent_open(cf->file_wd);
469 cvs_ent_remove(entlist, cf->file_name);
470 cvs_history_add(CVS_HISTORY_UPDATE_REMOVE, cf, NULL);
473 cvs_checkout_file(cf, cf->file_rcsrev, tag, CO_REMOVE);
483 if (cf->file_rcs->rf_dead != 1 &&
484 (cf->file_flags & FILE_HAS_TAG))
485 cvs_checkout_file(cf, cf->file_rcsrev,
493 update_join_file(cf);
497 update_clear_conflict(struct cvs_file *cf)
503 cvs_log(LP_TRACE, "update_clear_conflict(%s)", cf->file_path);
505 rcsnum_tostr(cf->file_rcsrev, revbuf, sizeof(revbuf));
508 if (cf->file_ent != NULL && cf->file_ent->ce_tag != NULL)
510 cf->file_ent->ce_tag);
513 if (cf->file_ent != NULL && cf->file_ent->ce_opts != NULL)
514 strlcpy(opt, cf->file_ent->ce_opts, sizeof(opt));
517 cvs_ent_line_str(cf->file_name, revbuf, "Result of merge",
521 entlist = cvs_ent_open(cf->file_wd);
532 update_has_conflict_markers(struct cvs_file *cf)
541 cvs_log(LP_TRACE, "update_has_conflict_markers(%s)", cf->file_path);
543 if (!(cf->file_flags & FILE_ON_DISK) || cf->file_ent == NULL)
546 bp = buf_load_fd(cf->fd);
576 update_join_file(struct cvs_file *cf)
605 rev2 = rcs_translate_tag(jrev2, cf->file_rcs);
617 rev1 = rcs_translate_tag(jrev1, cf->file_rcs);
624 rcsnum_cpy(cf->file_rcsrev, rev1, 0);
630 state1 = rcs_state_get(cf->file_rcs, rev1);
632 state2 = rcs_state_get(cf->file_rcs, rev2);
638 if (cf->file_status == FILE_REMOVED ||
639 cf->file_rcs->rf_dead == 1)
642 if (cf->file_status == FILE_MODIFIED ||
643 cf->file_status == FILE_ADDED)
646 (void)unlink(cf->file_path);
647 (void)close(cf->fd);
648 cf->fd = -1;
649 cvs_remove_local(cf);
653 if (cf->file_ent != NULL) {
654 if (!rcsnum_cmp(cf->file_ent->ce_rev, rev2, 0))
658 if (cf->file_rcsrev == NULL) {
660 cf->file_path);
665 if (cf->file_flags & FILE_ON_DISK) {
667 cf->file_path, jrev2);
669 cvs_printf("A %s\n", cf->file_path);
670 cvs_checkout_file(cf, cf->file_rcsrev, NULL, 0);
671 cvs_add_local(cf);
679 if (!(cf->file_flags & FILE_ON_DISK)) {
681 cf->file_path, jrev2);
685 if (rcs_kwexp_get(cf->file_rcs) & RCS_KWEXP_NONE) {
687 cf->file_path);
698 rcsnum_tostr(cf->file_rcsrev, rbuf, sizeof(rbuf));
699 cvs_printf("into %s (%s)\n", cf->file_path, rbuf);
703 cvs_checkout_file(cf, cf->file_rcsrev, NULL, CO_MERGE);
706 update_clear_conflict(cf);
716 cvs_backup_file(struct cvs_file *cf)
721 if (cf->file_status == FILE_ADDED)
724 rcsnum_tostr(cf->file_ent->ce_rev, revstr, sizeof(revstr));
727 cf->file_wd, cf->file_name, revstr);
729 cvs_file_copy(cf->file_path, backup_name);
732 cf->file_name, revstr);
734 cf->file_name, backup_name);