diff options
author | peter <peter@FreeBSD.org> | 1999-03-18 09:31:26 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1999-03-18 09:31:26 +0000 |
commit | 27155f7a1d4379301d235ed68ce8122166056427 (patch) | |
tree | 3473dbe51cc2bedc2006123efe76e3cd1f3c9bfe /contrib | |
parent | 0d50adfc046cabdc6bb5c12a9e561b000e6d45ae (diff) | |
download | FreeBSD-src-27155f7a1d4379301d235ed68ce8122166056427.zip FreeBSD-src-27155f7a1d4379301d235ed68ce8122166056427.tar.gz |
Merge cvs-1.9.xx -> 1.10 changes onto mainline.
The merge turned up a long-standing bug in local additions. I'm not
quite sure it's right yet. (the code in question is dealing with
diffs relative to "HEAD" and dead revisions).
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/cvs/src/diff.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/contrib/cvs/src/diff.c b/contrib/cvs/src/diff.c index 66d155e..ff1c4ed 100644 --- a/contrib/cvs/src/diff.c +++ b/contrib/cvs/src/diff.c @@ -434,16 +434,23 @@ diff_fileproc (callerdat, finfo) exists = 0; /* special handling for TAG_HEAD */ if (diff_rev1 && strcmp (diff_rev1, TAG_HEAD) == 0) - exists = (vers->vn_rcs != NULL && /* XXX ? */ - !RCS_isdead (vers->srcfile, vers->vn_rcs)); /*XXX*/ + { + char *head = + (vers->vn_rcs == NULL + ? NULL + : RCS_branch_head (vers->srcfile, vers->vn_rcs)); + exists = head != NULL; + if (head != NULL) + free (head); + } else { Vers_TS *xvers; xvers = Version_TS (finfo, NULL, diff_rev1, diff_date1, 1, 0); - exists = (vers->vn_rcs != NULL && - !RCS_isdead (vers->srcfile, vers->vn_rcs)); /*XXX*/ + exists = (xvers->vn_rcs != NULL && + !RCS_isdead (xvers->srcfile, xvers->vn_rcs)); /*XXX*/ freevers_ts (&xvers); } if (exists) @@ -816,7 +823,9 @@ diff_file_nodiff (finfo, vers, empty_file) { /* special handling for TAG_HEAD */ if (diff_rev1 && strcmp (diff_rev1, TAG_HEAD) == 0) - use_rev1 = xstrdup (vers->vn_rcs); + 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); @@ -829,7 +838,9 @@ diff_file_nodiff (finfo, vers, empty_file) { /* special handling for TAG_HEAD */ if (diff_rev2 && strcmp (diff_rev2, TAG_HEAD) == 0) - use_rev2 = xstrdup (vers->vn_rcs); + 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); |