2 * Copyright (C) 1986-2005 The Free Software Foundation, Inc.
4 * Portions Copyright (C) 1998-2005 Derek Price, Ximbiot <http://ximbiot.com>,
7 * Portions Copyright (C) 1992, Brian Berliner and Jeff Polk
8 * Portions Copyright (C) 1989-1992, Brian Berliner
10 * You may distribute under the terms of the GNU General Public License as
11 * specified in the README file that comes with the CVS source distribution.
15 * The user file looks modified judging from its time stamp; however it needn't
16 * be. No_Difference() finds out whether it is or not. If it is not, it
17 * updates the administration.
19 * returns 0 if no differences are found and non-zero otherwise
26 No_Difference (finfo, vers)
27 struct file_info *finfo;
36 /* If ts_user is "Is-modified", we can only conclude the files are
37 different (since we don't have the file's contents). */
38 if (vers->ts_user != NULL
39 && strcmp (vers->ts_user, "Is-modified") == 0)
42 if (!vers->srcfile || !vers->srcfile->path)
43 return (-1); /* different since we couldn't tell */
45 #ifdef PRESERVE_PERMISSIONS_SUPPORT
46 /* If special files are in use, then any mismatch of file metadata
47 information also means that the files should be considered different. */
48 if (preserve_perms && special_file_mismatch (finfo, vers->vn_user, NULL))
52 if (vers->entdata && vers->entdata->options)
53 options = xstrdup (vers->entdata->options);
55 options = xstrdup ("");
57 tocvsPath = wrap_tocvs_process_file (finfo->file);
58 retcode = RCS_cmp_file( vers->srcfile, vers->vn_user, (char **)NULL,
59 (char *)NULL, options,
60 tocvsPath == NULL ? finfo->file : tocvsPath );
63 /* no difference was found, so fix the entries file */
64 ts = time_stamp (finfo->file);
65 Register (finfo->entries, finfo->file,
66 vers->vn_user ? vers->vn_user : vers->vn_rcs, ts,
67 options, vers->tag, vers->date, (char *) 0);
71 /* We need to update the entries line on the client side. */
73 (finfo->file, finfo->update_dir, finfo->repository, SERVER_UPDATED);
78 /* update the entdata pointer in the vers_ts structure */
79 p = findnode (finfo->entries, finfo->file);
81 vers->entdata = p->data;
86 ret = 1; /* files were really different */
90 /* Need to call unlink myself because the noexec variable
91 * has been set to 1. */
93 (void) fprintf (stderr, "%s-> unlink (%s)\n",
94 CLIENT_SERVER_STR, tocvsPath);
95 if ( CVS_UNLINK (tocvsPath) < 0)
96 error (0, errno, "could not remove %s", tocvsPath);