if (update_dir[0]) (void) printf ("D %s/%s\n", update_dir, file);
if (finfo->update_dir[0]) (void) printf ("D %s/%s\n", finfo->update_dir, finfo->file);
tag_fileproc (file, update_dir, repository, entries, srcfiles)    char *file;    char *update_dir;    char *repository;    List *entries;    List *srcfiles;{    char *version, *oversion;    char *nversion = NULL;    char *rev;    Vers_TS *vers;    int retcode = 0;    vers = Version_TS (repository, (char *) NULL, (char *) NULL, (char *) NULL,		       file, 0, 0, entries, srcfiles);    if ((numtag != NULL) || (date != NULL))    {        nversion = RCS_getversion(vers->srcfile,                                  numtag,                                  date,                                  force_tag_match, 0);        if (nversion == NULL)        {	    freevers_ts (&vers);            return (0);        }    }    if (delete)    {	/*	 * If -d is specified, "force_tag_match" is set, so that this call to	 * Version_Number() will return a NULL version string if the symbolic	 * tag does not exist in the RCS file.	 * 	 * This is done here because it's MUCH faster than just blindly calling	 * "rcs" to remove the tag... trust me.	 */	version = RCS_getversion (vers->srcfile, symtag, (char *) NULL, 1, 0);	if (version == NULL || vers->srcfile == NULL)	{	    freevers_ts (&vers);	    return (0);	}	free (version);	if ((retcode = RCS_deltag(vers->srcfile->path, symtag, 1)) != 0) 	{	    if (!quiet)		error (0, retcode == -1 ? errno : 0,		       "failed to remove tag %s from %s", symtag,		       vers->srcfile->path);	    freevers_ts (&vers);	    return (1);	}	/* warm fuzzies */	if (!really_quiet)	{	    if (update_dir[0])		(void) printf ("D %s/%s\n", update_dir, file);	    else		(void) printf ("D %s\n", file);	}	freevers_ts (&vers);	return (0);    }    /*     * If we are adding a tag, we need to know which version we have checked     * out and we'll tag that version.     */    if (nversion == NULL)    {        version = vers->vn_user;    }    else    {        version = nversion;    }    if (version == NULL)    {	freevers_ts (&vers);	return (0);    }    else if (strcmp (version, "0") == 0)    {	if (!quiet)	    error (0, 0, "couldn't tag added but un-commited file `%s'", file);	freevers_ts (&vers);	return (0);    }    else if (version[0] == '-')    {	if (!quiet)	    error (0, 0, "skipping removed but un-commited file `%s'", file);	freevers_ts (&vers);	return (0);    }    else if (vers->srcfile == NULL)    {	if (!quiet)	    error (0, 0, "cannot find revision control file for `%s'", file);	freevers_ts (&vers);	return (0);    }    /*     * As an enhancement for the case where a tag is being re-applied to a     * large number of files, make one extra call to Version_Number to see if     * the tag is already set in the RCS file.  If so, check to see if it     * needs to be moved.  If not, do nothing.  This will likely save a lot of     * time when simply moving the tag to the "current" head revisions of a     * module -- which I have found to be a typical tagging operation.     */    rev = branch_mode ? RCS_magicrev (vers->srcfile, version) : version;    oversion = RCS_getversion (vers->srcfile, symtag, (char *) NULL, 1, 0);    if (oversion != NULL)    {       int isbranch = RCS_isbranch (file, symtag, srcfiles);       /*	* if versions the same and neither old or new are branches don't have 	* to do anything	*/       if (strcmp (version, oversion) == 0 && !branch_mode && !isbranch)       {	  free (oversion);	  freevers_ts (&vers);	  return (0);       }              if (!force_tag_move) {		/* we're NOT going to move the tag */	  if (update_dir[0])	     (void) printf ("W %s/%s", update_dir, file);	  else	     (void) printf ("W %s", file);	  (void) printf (" : %s already exists on %s %s", 			 symtag, isbranch ? "branch" : "version", oversion);	  (void) printf (" : NOT MOVING tag to %s %s\n", 			 branch_mode ? "branch" : "version", rev);	  free (oversion);	  freevers_ts (&vers);	  return (0);       }       free (oversion);    }    if ((retcode = RCS_settag(vers->srcfile->path, symtag, rev)) != 0)    {	error (1, retcode == -1 ? errno : 0,	       "failed to set tag %s to revision %s in %s",	       symtag, rev, vers->srcfile->path);	freevers_ts (&vers);	return (1);    }    /* more warm fuzzies */    if (!really_quiet)    {	if (update_dir[0])	    (void) printf ("T %s/%s\n", update_dir, file);	else	    (void) printf ("T %s\n", file);    }    freevers_ts (&vers);    if (nversion != NULL)    {        free(nversion);    }    return (0);}