#include "cvs.h"
#include <assert.h>
int
No_Difference (finfo, vers)
struct file_info *finfo;
Vers_TS *vers;
{
Node *p;
int ret;
char *ts, *options;
int retcode = 0;
char *tocvsPath;
if (vers->ts_user != NULL
&& strcmp (vers->ts_user, "Is-modified") == 0)
return -1;
if (!vers->srcfile || !vers->srcfile->path)
return (-1);
#ifdef PRESERVE_PERMISSIONS_SUPPORT
if (preserve_perms && special_file_mismatch (finfo, vers->vn_user, NULL))
return 1;
#endif
if (vers->entdata && vers->entdata->options)
options = xstrdup (vers->entdata->options);
else
options = xstrdup ("");
tocvsPath = wrap_tocvs_process_file (finfo->file);
retcode = RCS_cmp_file( vers->srcfile, vers->vn_user, (char **)NULL,
(char *)NULL, options,
tocvsPath == NULL ? finfo->file : tocvsPath );
if (retcode == 0)
{
ts = time_stamp (finfo->file);
Register (finfo->entries, finfo->file,
vers->vn_user ? vers->vn_user : vers->vn_rcs, ts,
options, vers->tag, vers->date, (char *) 0);
#ifdef SERVER_SUPPORT
if (server_active)
{
server_update_entries
(finfo->file, finfo->update_dir, finfo->repository, SERVER_UPDATED);
}
#endif
free (ts);
p = findnode (finfo->entries, finfo->file);
assert (p);
vers->entdata = p->data;
ret = 0;
}
else
ret = 1;
if (tocvsPath)
{
if (trace)
(void) fprintf (stderr, "%s-> unlink (%s)\n",
CLIENT_SERVER_STR, tocvsPath);
if ( CVS_UNLINK (tocvsPath) < 0)
error (0, errno, "could not remove %s", tocvsPath);
}
free (options);
return (ret);
}