bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: rdiff


From: Paul Edwards
Subject: Re: rdiff
Date: Thu, 29 May 2003 21:40:04 GMT

"Derek Robert Price" <address@hidden> wrote in message news:address@hidden
> On the current stable tree, your changes to patch.c were made some time ago.
>
> Once I apply your changes to diff.c, I do see the improvements you
> mentioned, but I also start seeing failures in the death2 sanity tests.
>  Specifically, death2-diff-3 starts reporting that it can't find a file
> that exists in the repository with two revisions specified rather than
> reporting that the file was removed.

Ok, it sounds like more things are falling into that other bug that
I mentioned (reproduced below).  In my opinion use_rev2 should
be NULL for that removed file, and thus detected as removed,
before hitting my code change.

But I don't know how to get use_rev2 to be NULL.  Any ideas?

BFN.  Paul.


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;
 }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]