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 (struct file_info
*finfo
, Vers_TS
*vers
)
34 /* If ts_user is "Is-modified", we can only conclude the files are
35 different (since we don't have the file's contents). */
36 if (vers
->ts_user
!= NULL
37 && strcmp (vers
->ts_user
, "Is-modified") == 0)
40 if (!vers
->srcfile
|| !vers
->srcfile
->path
)
41 return (-1); /* different since we couldn't tell */
43 #ifdef PRESERVE_PERMISSIONS_SUPPORT
44 /* If special files are in use, then any mismatch of file metadata
45 information also means that the files should be considered different. */
46 if (preserve_perms
&& special_file_mismatch (finfo
, vers
->vn_user
, NULL
))
50 if (vers
->entdata
&& vers
->entdata
->options
)
51 options
= xstrdup (vers
->entdata
->options
);
53 options
= xstrdup ("");
55 tocvsPath
= wrap_tocvs_process_file (finfo
->file
);
56 retcode
= RCS_cmp_file (vers
->srcfile
, vers
->vn_user
, NULL
, NULL
, options
,
57 tocvsPath
== NULL
? finfo
->file
: tocvsPath
);
60 /* no difference was found, so fix the entries file */
61 ts
= time_stamp (finfo
->file
);
62 Register (finfo
->entries
, finfo
->file
,
63 vers
->vn_user
? vers
->vn_user
: vers
->vn_rcs
, ts
,
64 options
, vers
->tag
, vers
->date
, NULL
);
68 /* We need to update the entries line on the client side. */
69 server_update_entries (finfo
->file
, finfo
->update_dir
,
70 finfo
->repository
, SERVER_UPDATED
);
75 /* update the entdata pointer in the vers_ts structure */
76 p
= findnode (finfo
->entries
, finfo
->file
);
78 vers
->entdata
= p
->data
;
83 ret
= 1; /* files were really different */
87 /* Need to call unlink myself because the noexec variable
88 * has been set to 1. */
89 TRACE (TRACE_FUNCTION
, "unlink (%s)", tocvsPath
);
90 if ( CVS_UNLINK (tocvsPath
) < 0)
91 error (0, errno
, "could not remove %s", tocvsPath
);