diff doesn't know dead means dead

"Paul Edwards" <[email protected]>
Newsgroups gmane.comp.version-control.cvs.bugs
Organization BigPond Internet Services (http://www.bigpond.net.au)
Message-ID <[email protected]>
With cvs 1.11.6, if I go to a directory and go:

cvs diff -r abc -r def file.c

Then if abc is NOT in the file, use_rev1 is NULL.
But if def IS in the file, BUT DEAD, then use_rev2 is NOT NULL.

Which is unfortunate, because that means I either get a
message "tag abc is not in file file.c" or else, if I used the
"-N" option, which I do, then it gives me a full diff listing
as if this was an added file.

Any idea where in the below code there should be something
the recognizes that dead means dead?

Thanks.  Paul.


    use_rev1 = use_rev2 = (char *) NULL;

    if (diff_rev1 || diff_date1)
    {
 /* special handling for TAG_HEAD */
 if (diff_rev1 && strcmp (diff_rev1, TAG_HEAD) == 0)
     use_rev1 = ((vers->vn_rcs == NULL || vers->srcfile == NULL)
   ? NULL
   : RCS_branch_head (vers->srcfile, vers->vn_rcs));
 else
 {
     xvers = Version_TS (finfo, NULL, diff_rev1, diff_date1, 1, 0);
     if (xvers->vn_rcs != NULL)
  use_rev1 = xstrdup (xvers->vn_rcs);
     freevers_ts (&xvers);
 }
    }
    if (diff_rev2 || diff_date2)
    {
 /* special handling for TAG_HEAD */
 if (diff_rev2 && strcmp (diff_rev2, TAG_HEAD) == 0)
     use_rev2 = ((vers->vn_rcs == NULL || vers->srcfile == NULL)
   ? NULL
   : RCS_branch_head (vers->srcfile, vers->vn_rcs));
 else
 {
     xvers = Version_TS (finfo, NULL, diff_rev2, diff_date2, 1, 0);
     if (xvers->vn_rcs != NULL)
  use_rev2 = xstrdup (xvers->vn_rcs);
     freevers_ts (&xvers);
 }

 if (use_rev1 == NULL)
 {
     /* The first revision does not exist.  If EMPTY_FILES is
               true, treat this as an added file.  Otherwise, warn
               about the missing tag.  */
     if (use_rev2 == NULL)
  /* At least in the case where DIFF_REV1 and DIFF_REV2
     are both numeric, we should be returning some kind
     of error (see basicb-8a0 in testsuite).  The symbolic
     case may be more complicated.  */
  return DIFF_SAME;
     else if (empty_files)
  return DIFF_ADDED;
     else if (diff_rev1)
  error (0, 0, "tag %s is not in file %s", diff_rev1,
         finfo->fullname);
     else
  error (0, 0, "no revision for date %s in file %s",
         diff_date1, finfo->fullname);
     return DIFF_ERROR;
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.