Lines Matching refs:cf

233 	struct cvs_filelist *cf;  in cvs_commit_loginfo()  local
245 RB_FOREACH(cf, cvs_flisthead, &files_added) { in cvs_commit_loginfo()
248 buf_puts(buf, cf->file_path); in cvs_commit_loginfo()
257 RB_FOREACH(cf, cvs_flisthead, &files_modified) { in cvs_commit_loginfo()
260 buf_puts(buf, cf->file_path); in cvs_commit_loginfo()
269 RB_FOREACH(cf, cvs_flisthead, &files_removed) { in cvs_commit_loginfo()
272 buf_puts(buf, cf->file_path); in cvs_commit_loginfo()
289 cvs_commit_lock_dirs(struct cvs_file *cf) in cvs_commit_lock_dirs() argument
293 cvs_get_repository_path(cf->file_wd, repo, sizeof(repo)); in cvs_commit_lock_dirs()
301 cvs_commit_check_files(struct cvs_file *cf) in cvs_commit_check_files() argument
308 cvs_log(LP_TRACE, "cvs_commit_check_files(%s)", cf->file_path); in cvs_commit_check_files()
311 cvs_remote_classify_file(cf); in cvs_commit_check_files()
313 cvs_file_classify(cf, cvs_directory_tag); in cvs_commit_check_files()
315 if (cf->file_type == CVS_DIR) { in cvs_commit_check_files()
317 cvs_log(LP_NOTICE, "Examining %s", cf->file_path); in cvs_commit_check_files()
321 if (cf->file_status == FILE_UPTODATE) in cvs_commit_check_files()
324 if (cf->file_status == FILE_MERGE || in cvs_commit_check_files()
325 cf->file_status == FILE_PATCH || in cvs_commit_check_files()
326 cf->file_status == FILE_CHECKOUT || in cvs_commit_check_files()
327 cf->file_status == FILE_LOST || in cvs_commit_check_files()
328 cf->file_status == FILE_UNLINK) { in cvs_commit_check_files()
330 cf->file_path); in cvs_commit_check_files()
335 if (cf->file_status == FILE_CONFLICT && in cvs_commit_check_files()
336 cf->file_ent->ce_conflict != NULL) { in cvs_commit_check_files()
338 "merging, please fix these first", cf->file_path); in cvs_commit_check_files()
343 if (cf->file_status == FILE_MODIFIED && in cvs_commit_check_files()
344 cf->file_ent->ce_conflict != NULL && in cvs_commit_check_files()
345 update_has_conflict_markers(cf)) { in cvs_commit_check_files()
347 "conflict indicators", cf->file_path); in cvs_commit_check_files()
350 if (cf->file_ent != NULL && cf->file_ent->ce_date != -1) { in cvs_commit_check_files()
352 cf->file_path); in cvs_commit_check_files()
359 if (cf->file_ent != NULL) in cvs_commit_check_files()
360 tag = cf->file_ent->ce_tag; in cvs_commit_check_files()
362 if (tag != NULL && cf->file_rcs != NULL) { in cvs_commit_check_files()
363 brev = rcs_sym_getrev(cf->file_rcs, tag); in cvs_commit_check_files()
368 cf->file_path); in cvs_commit_check_files()
378 if (cf->file_status != FILE_ADDED && in cvs_commit_check_files()
379 cf->file_status != FILE_REMOVED && in cvs_commit_check_files()
380 cf->file_status != FILE_MODIFIED) in cvs_commit_check_files()
383 cvs_file_get(cf->file_path, 0, &files_affected, CVS_FILE); in cvs_commit_check_files()
385 switch (cf->file_status) { in cvs_commit_check_files()
387 cvs_file_get(cf->file_path, 0, &files_added, CVS_FILE); in cvs_commit_check_files()
390 cvs_file_get(cf->file_path, 0, &files_removed, CVS_FILE); in cvs_commit_check_files()
393 cvs_file_get(cf->file_path, 0, &files_modified, CVS_FILE); in cvs_commit_check_files()
399 cvs_commit_local(struct cvs_file *cf) in cvs_commit_local() argument
411 cvs_log(LP_TRACE, "cvs_commit_local(%s)", cf->file_path); in cvs_commit_local()
412 cvs_file_classify(cf, cvs_directory_tag); in cvs_commit_local()
417 if (cf->file_type != CVS_FILE) in cvs_commit_local()
418 fatal("cvs_commit_local: '%s' is not a file", cf->file_path); in cvs_commit_local()
421 if (cf->file_ent != NULL && cf->file_ent->ce_tag != NULL) in cvs_commit_local()
422 tag = cf->file_ent->ce_tag; in cvs_commit_local()
425 switch (cf->file_status) { in cvs_commit_local()
427 if (cf->file_rcs == NULL && tag != NULL) { in cvs_commit_local()
429 cvs_add_tobranch(cf, tag); in cvs_commit_local()
434 if (cf->file_rcs == NULL) { in cvs_commit_local()
436 cf->file_path); in cvs_commit_local()
441 cvs_log(LP_ERR, "skipping bogus file `%s'", cf->file_path); in cvs_commit_local()
451 if (cf->file_rcs != NULL && cf->file_rcs->rf_branch != NULL) { in cvs_commit_local()
452 free(cf->file_rcs->rf_branch); in cvs_commit_local()
453 cf->file_rcs->rf_branch = NULL; in cvs_commit_local()
456 if (cf->file_rcs != NULL) { in cvs_commit_local()
457 rrev = rcs_head_get(cf->file_rcs); in cvs_commit_local()
458 crev = rcs_head_get(cf->file_rcs); in cvs_commit_local()
461 cf->file_path); in cvs_commit_local()
466 brev = rcs_sym_getrev(cf->file_rcs, tag); in cvs_commit_local()
467 crev = rcs_translate_tag(tag, cf->file_rcs); in cvs_commit_local()
504 if (cf->file_status == FILE_ADDED) { in cvs_commit_local()
508 if (cf->file_rcs != NULL) { in cvs_commit_local()
510 if (cf->in_attic == 0) in cvs_commit_local()
513 cf->file_path); in cvs_commit_local()
515 if (cf->file_rcs->rf_dead == 0) in cvs_commit_local()
517 "to be dead", cf->file_path); in cvs_commit_local()
519 cvs_get_repository_path(cf->file_wd, repo, in cvs_commit_local()
522 repo, cf->file_name, RCS_FILE_EXT); in cvs_commit_local()
524 if (rename(cf->file_rpath, rcsfile) == -1) in cvs_commit_local()
527 cf->file_path, strerror(errno)); in cvs_commit_local()
529 free(cf->file_rpath); in cvs_commit_local()
530 cf->file_rpath = xstrdup(rcsfile); in cvs_commit_local()
536 rcs_close(cf->file_rcs); in cvs_commit_local()
539 cf->repo_fd = open(cf->file_rpath, openflags); in cvs_commit_local()
540 if (cf->repo_fd == -1) in cvs_commit_local()
543 cf->file_rcs = rcs_open(cf->file_rpath, cf->repo_fd, in cvs_commit_local()
545 if (cf->file_rcs == NULL) in cvs_commit_local()
547 "for %s", cf->file_path); in cvs_commit_local()
549 commit_desc_set(cf); in cvs_commit_local()
556 cvs_printf("Checking in %s:\n", cf->file_path); in cvs_commit_local()
557 cvs_printf("%s <- %s\n", cf->file_rpath, cf->file_path); in cvs_commit_local()
561 if (isnew == 0 && cf->file_rcs->rf_head == NULL) in cvs_commit_local()
562 fatal("no head revision in RCS file for %s", cf->file_path); in cvs_commit_local()
565 d = commit_diff(cf, cf->file_rcs->rf_head, 0); in cvs_commit_local()
567 if (cf->file_status == FILE_REMOVED) { in cvs_commit_local()
568 b = rcs_rev_getbuf(cf->file_rcs, crev, 0); in cvs_commit_local()
570 b = commit_diff(cf, crev, 1); in cvs_commit_local()
572 b = buf_load_fd(cf->fd); in cvs_commit_local()
576 if (rcs_deltatext_set(cf->file_rcs, crev, d) == -1) in cvs_commit_local()
580 if (rcs_rev_add(cf->file_rcs, nrev, logmsg, -1, NULL) == -1) in cvs_commit_local()
584 nrev = cf->file_rcs->rf_head; in cvs_commit_local()
586 if (rcs_deltatext_set(cf->file_rcs, nrev, b) == -1) in cvs_commit_local()
589 if (cf->file_status == FILE_REMOVED) { in cvs_commit_local()
590 if (rcs_state_set(cf->file_rcs, nrev, RCS_STATE_DEAD) == -1) in cvs_commit_local()
594 if (cf->file_status == FILE_ADDED && cf->file_ent->ce_opts != NULL) { in cvs_commit_local()
597 cf_kflag = rcs_kflag_get(cf->file_ent->ce_opts + 2); in cvs_commit_local()
598 rcs_kwexp_set(cf->file_rcs, cf_kflag); in cvs_commit_local()
601 rcs_write(cf->file_rcs); in cvs_commit_local()
603 if (cf->file_status == FILE_REMOVED) { in cvs_commit_local()
605 } else if (cf->file_status == FILE_ADDED) { in cvs_commit_local()
606 if (cf->file_rcs->rf_dead == 1) in cvs_commit_local()
610 } else if (cf->file_status == FILE_MODIFIED) { in cvs_commit_local()
617 (void)unlink(cf->file_path); in cvs_commit_local()
618 (void)close(cf->fd); in cvs_commit_local()
619 cf->fd = -1; in cvs_commit_local()
621 if (cf->file_status != FILE_REMOVED) { in cvs_commit_local()
622 cvs_checkout_file(cf, nrev, NULL, CO_COMMIT); in cvs_commit_local()
624 entlist = cvs_ent_open(cf->file_wd); in cvs_commit_local()
625 cvs_ent_remove(entlist, cf->file_name); in cvs_commit_local()
627 cvs_get_repository_path(cf->file_wd, repo, PATH_MAX); in cvs_commit_local()
636 CVS_PATH_ATTIC, cf->file_name, RCS_FILE_EXT); in cvs_commit_local()
638 if (rename(cf->file_rpath, attic) == -1) in cvs_commit_local()
640 cf->file_path); in cvs_commit_local()
643 cvs_server_update_entry("Remove-entry", cf); in cvs_commit_local()
650 cf->file_path, rbuf, nbuf); in cvs_commit_local()
655 fi->file_path = xstrdup(cf->file_path); in cvs_commit_local()
663 switch (cf->file_status) { in cvs_commit_local()
681 cvs_history_add(histtype, cf, NULL); in cvs_commit_local()
683 cvs_log(LP_NOTICE, "histtype was -1 for %s", cf->file_path); in cvs_commit_local()
687 commit_diff(struct cvs_file *cf, RCSNUM *rev, int reverse) in commit_diff() argument
695 if (cf->file_status == FILE_MODIFIED || in commit_diff()
696 cf->file_status == FILE_ADDED) { in commit_diff()
697 b = buf_load_fd(cf->fd); in commit_diff()
701 fd1 = rcs_rev_write_stmp(cf->file_rcs, rev, p1, 0); in commit_diff()
705 fd2 = rcs_rev_write_stmp(cf->file_rcs, rev, p2, RCS_KWEXP_NONE); in commit_diff()
728 commit_desc_set(struct cvs_file *cf) in commit_desc_set() argument
735 cf->file_wd, CVS_PATH_CVSDIR, cf->file_name, CVS_DESCR_FILE_EXT); in commit_desc_set()
744 rcs_desc_set(cf->file_rcs, desc); in commit_desc_set()