Lines Matching defs:finfo

54 static int checkout_file (struct file_info *finfo, Vers_TS *vers_ts,
58 static int patch_file (struct file_info *finfo,
64 static int merge_file (struct file_info *finfo, Vers_TS *vers);
65 static int scratch_file (struct file_info *finfo, Vers_TS *vers);
80 static void join_file (struct file_info *finfo, Vers_TS *vers_ts);
545 get_linkinfo_proc (void *callerdat, struct file_info *finfo)
552 fullpath = Xasprintf ("%s/%s", working_dir, finfo->fullname);
590 update_fileproc (void *callerdat, struct file_info *finfo)
596 status = Classify_File (finfo, tag, date, options, force_tag_match,
604 && finfo->rcs != NULL)
606 char *rev = RCS_getversion (finfo->rcs, tag, NULL, 1, NULL);
608 && nonbranch != (nb = !RCS_nodeisbranch (finfo->rcs, tag)))
649 retval = checkout_file (finfo, vers, 0, 0, 0);
654 "unknown file status %d for file %s", status, finfo->file);
670 write_letter (finfo, 'C');
675 retval = merge_file (finfo, vers);
684 bakname = backup_file (finfo->file, vers->vn_user);
689 finfo->file, bakname);
696 retval = checkout_file (finfo, vers, 0, 0, 1);
702 if (file_has_markers (finfo))
704 write_letter (finfo, 'C');
710 Register (finfo->entries, finfo->file,
717 write_letter (finfo, 'M');
728 retval = patch_file (finfo,
734 server_updated (finfo, vers,
749 retval = checkout_file (finfo, vers, 0, 0, 1);
752 write_letter (finfo, 'A');
756 write_letter (finfo, 'R');
760 retval = scratch_file (finfo, vers);
764 "unknown file status %d for file %s", status, finfo->file);
772 join_file (finfo, vers);
781 p->key = xstrdup (finfo->file);
795 struct file_info finfo;
798 memset (&finfo, 0, sizeof (finfo));
799 finfo.file = file;
800 finfo.update_dir = dir;
802 finfo.fullname = tmp = Xasprintf ("%s%s%s",
806 write_letter (&finfo, '?');
1154 scratch_file (struct file_info *finfo, Vers_TS *vers)
1156 history_write ('W', finfo->update_dir, "", finfo->file, finfo->repository);
1157 Scratch_Entry (finfo->entries, finfo->file);
1163 server_updated (finfo, vers, SERVER_UPDATED, (mode_t) -1, NULL, NULL);
1166 if (unlink_file (finfo->file) < 0 && ! existence_error (errno))
1167 error (0, errno, "unable to remove %s", finfo->fullname);
1195 checkout_file (struct file_info *finfo, Vers_TS *vers_ts, int adding,
1211 backup = Xasprintf ("%s/%s%s", CVSADM, CVSPREFIX, finfo->file);
1212 if (isfile (finfo->file))
1213 rename_file (finfo->file, backup);
1244 cvs_outerr (finfo->fullname, 0);
1261 && ! wrap_name_has (finfo->file, WRAP_FROMCVS))
1272 pipeout ? NULL : finfo->file,
1307 && !fileattr_get (finfo->file, "_watched"))
1310 xchmod (finfo->file, 1);
1337 editor_set (finfo->file, getcaller (), NULL);
1341 watch_modify_watchers (finfo->file, &args);
1351 wrap_fromcvs_process_file (finfo->file);
1353 xvers_ts = Version_TS (finfo, options, tag, date,
1387 finfo->fullname);
1389 Scratch_Entry (finfo->entries, finfo->file);
1399 if (unlink_file (finfo->file) < 0 && ! existence_error (errno))
1401 error (0, errno, "cannot remove %s", finfo->fullname);
1405 Register (finfo->entries, finfo->file,
1426 history_write ('U', finfo->update_dir, xvers_ts->vn_rcs, finfo->file,
1427 finfo->repository);
1433 write_letter (finfo, 'U');
1439 server_updated (finfo, vers_ts,
1448 rename_file (backup, finfo->file);
1453 error (0, 0, "could not check out %s", finfo->fullname);
1520 patch_file (struct file_info *finfo, Vers_TS *vers_ts, int *docheckout,
1559 rev = RCS_gettag (finfo->rcs, vers_ts->vn_user, 1, NULL);
1577 backup = Xasprintf ("%s/%s%s", CVSADM, CVSPREFIX, finfo->file);
1578 if (isfile (finfo->file))
1579 rename_file (finfo->file, backup);
1587 file1 = Xasprintf ("%s/%s%s-1", CVSADM, CVSPREFIX, finfo->file);
1588 file2 = Xasprintf ("%s/%s%s-2", CVSADM, CVSPREFIX, finfo->file);
1685 finfo->file);
1701 if (stat (finfo->file, file_info) < 0)
1702 error (1, errno, "could not stat %s", finfo->file);
1714 e = CVS_FOPEN (finfo->file, "r");
1717 finfo->fullname);
1738 if (chmod (finfo->file,
1741 error (0, errno, "cannot change mode of file %s", finfo->file);
1743 && !fileattr_get (finfo->file, "_watched"))
1744 xchmod (finfo->file, 1);
1748 xvers_ts = Version_TS (finfo, options, tag, date,
1753 Register (finfo->entries, finfo->file, xvers_ts->vn_rcs,
1757 if (stat (finfo->file, file_info) < 0)
1758 error (1, errno, "could not stat %s", finfo->file);
1762 history_write ('P', finfo->update_dir, xvers_ts->vn_rcs,
1763 finfo->file, finfo->repository);
1769 write_letter (finfo, 'P');
1777 rename_file (backup, finfo->file);
1781 "could not diff %s", finfo->fullname);
1830 write_letter (struct file_info *finfo, int letter)
1857 cvs_output_tagged ("fname", finfo->fullname);
1872 RegisterMerge (struct file_info *finfo, Vers_TS *vers,
1883 cp = time_stamp (finfo->file);
1885 Register (finfo->entries, finfo->file, vers->vn_rcs ? vers->vn_rcs : "0",
1896 server_copy_file (finfo->file, finfo->update_dir, finfo->repository,
1898 server_updated (finfo, vers, SERVER_MERGED, (mode_t) -1, NULL, NULL);
1909 merge_file (struct file_info *finfo, Vers_TS *vers)
1924 backup = Xasprintf ("%s%s.%s", BAKPREFIX, finfo->file, vers->vn_user);
1928 copy_file (finfo->file, backup);
1929 xchmod (finfo->file, 1);
1932 || wrap_merge_is_copy (finfo->file)
1933 || special_file_mismatch (finfo, NULL, vers->vn_rcs))
1950 status = RCS_checkout (finfo->rcs, finfo->file, vers->vn_rcs,
1954 error (0, 0, "failed to check out `%s' file", finfo->fullname);
1956 finfo->fullname, backup);
1957 rename_file (backup, finfo->file);
1962 xchmod (finfo->file, 1);
1964 RegisterMerge (finfo, vers, backup, 1);
1972 vers->vn_rcs, finfo->fullname);
1974 write_letter (finfo, 'C');
1976 history_write ('C', finfo->update_dir, vers->vn_rcs, finfo->file,
1977 finfo->repository);
1982 status = RCS_merge (finfo->rcs, vers->srcfile->path, finfo->file,
1987 "could not merge revision %s of %s", vers->vn_user, finfo->fullname);
1989 finfo->fullname, backup);
1990 rename_file (backup, finfo->file);
2008 RegisterMerge (finfo, vers, backup, status);
2012 error (0, 0, "conflicts found in %s", finfo->fullname);
2014 write_letter (finfo, 'C');
2016 history_write ('C', finfo->update_dir, vers->vn_rcs, finfo->file,
2017 finfo->repository);
2022 history_write ('G', finfo->update_dir, vers->vn_rcs, finfo->file,
2023 finfo->repository);
2027 if (!noexec && !xcmp (backup, finfo->file))
2029 cvs_output (finfo->fullname, 0);
2040 write_letter (finfo, 'M');
2055 * finfo File information about the destination file.
2056 * vers The Vers_TS structure for finfo.
2067 join_file (struct file_info *finfo, Vers_TS *vers)
2081 finfo->file,
2213 finfo->fullname, jrev2, jdate2);
2217 finfo->fullname, jrev2);
2238 finfo->fullname, jrev2, jdate2);
2242 finfo->fullname, jrev2);
2270 server_scratch (finfo->file);
2271 server_updated (finfo, vers, SERVER_UPDATED, (mode_t) -1,
2275 Register (finfo->entries, finfo->file, mrev, vers->ts_rcs,
2281 if (unlink_file (finfo->file) < 0 && ! existence_error (errno))
2282 error (0, errno, "cannot remove file %s", finfo->fullname);
2285 server_checked_in (finfo->file, finfo->update_dir,
2286 finfo->repository);
2289 error (0, 0, "scheduling `%s' for removal", finfo->fullname);
2317 cvs_output (finfo->fullname, 0);
2348 xvers = Version_TS (finfo, vers->options, jrev2, jdate2, 1, 0);
2359 status = checkout_file (finfo, xvers, 1, 0, 1);
2374 finfo->fullname, jrev2, jdate2);
2378 finfo->fullname, jrev2);
2392 finfo->fullname, jrev2, jdate2);
2396 finfo->fullname, jrev2);
2404 if (server_active && !isreadable (finfo->file))
2411 retcode = RCS_checkout (vers->srcfile, finfo->file,
2416 "failed to check out %s file", finfo->fullname);
2427 backup = Xasprintf ("%s%s.%s", BAKPREFIX, finfo->file, vers->vn_user);
2432 copy_file (finfo->file, backup);
2433 xchmod (finfo->file, 1);
2456 || wrap_merge_is_copy (finfo->file)))
2474 if (RCS_checkout (finfo->rcs, finfo->file, rev2, NULL, t_options,
2487 xchmod (finfo->file, 1);
2496 write_letter (finfo, 'U');
2499 || wrap_merge_is_copy (finfo->file)
2500 || special_file_mismatch (finfo, rev1, rev2))
2509 if (RCS_checkout (finfo->rcs, finfo->file, rev2, NULL,
2522 xchmod (finfo->file, 1);
2534 rev2, finfo->fullname);
2536 write_letter (finfo, 'C');
2539 status = RCS_merge (finfo->rcs, vers->srcfile->path, finfo->file,
2547 "could not merge revision %s of %s", rev2, finfo->fullname);
2549 finfo->fullname, backup);
2550 rename_file (backup, finfo->file);
2557 if (!noexec && !xcmp (backup, finfo->file))
2561 cvs_output (finfo->fullname, 0);
2586 RegisterMerge (finfo, vers, backup, status);
2610 special_file_mismatch (struct file_info *finfo, char *rev1, char *rev2)
2637 if (finfo->rcs->flags & PARTIAL)
2638 RCS_reparsercsfile (finfo->rcs, NULL, NULL);
2643 finfo->file and use that info. */
2651 if ((rsize = islink (finfo->file)) > 0)
2652 rev1_symlink = Xreadlink (finfo->file, rsize);
2656 if (lstat (finfo->file, &sb) < 0)
2658 finfo->file);
2666 finfo->file);
2669 rev1_hardlinks = list_linked_files_on_disk (finfo->file);
2673 n = findnode (finfo->rcs->versions, rev1);
2709 finfo->file, rev1, (char *)n->data);
2717 finfo->file, rev1, ftype);
2731 if ((rsize = islink (finfo->file)) > 0)
2732 rev2_symlink = Xreadlink (finfo->file, rsize);
2736 if (lstat (finfo->file, &sb) < 0)
2738 finfo->file);
2746 finfo->file);
2749 rev2_hardlinks = list_linked_files_on_disk (finfo->file);
2753 n = findnode (finfo->rcs->versions, rev2);
2789 finfo->file, rev2, (char *)n->data);
2797 finfo->file, rev2, ftype);
2834 finfo->file,
2844 finfo->file,
2855 finfo->file,
2865 finfo->file,
2875 finfo->file,
2886 finfo->file,