Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Sep 1997 19:35:03 -0700
From:      Julian Elischer <julian@whistle.com>
To:        "info-cvs@prep.ai.mit.edu" <info-cvs@prep.ai.mit.edu>, hackers@freebsd.org
Cc:        julian@whistle.com
Subject:   CVS BUG and FIX.
Message-ID:  <34233657.2781E494@whistle.com>
References:  <34135B01.6201DD56@whistle.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.

--------------15FB7483794BDF32446B9B3D
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

A few weeks ago I sent the following mail:
It contained a patch that "almost" worked.
Below I include what appears to be a more complete patch.

Interestingly the existing code does not work as advertised 
in the following case:
access;
symbols
        RELENG_2_2_2_RELEASE:1.2
        RELENG_2_2_1_RELEASE:1.2
        RELENG_2_2_0_RELEASE:1.2
        RELENG_2_1_7_RELEASE:1.2.4.1
        RELENG_2_1_6_1_RELEASE:1.2.4.1
        RELENG_2_1_6_RELEASE:1.2.4.1
        RELENG_2_2:1.2.0.6
        RELENG_2_2_BP:1.2
        RELENG_2_1_5_RELEASE:1.2.4.1
        RELENG_2_1_0_RELEASE:1.2
        RELENG_2_1_0:1.2.0.4
        RELENG_2_1_0_BP:1.2
        RELENG_2_0_5_RELEASE:1.2
        RELENG_2_0_5:1.2.0.2
        RELENG_2_0_5_BP:1.2
        RELENG_2_0_5_ALPHA:1.1.1.1
        RELEASE_2_0:1.1.1.1
        BETA_2_0:1.1.1.1
        ALPHA_2_0:1.1.1.1.0.2
        xntp_3_4e:1.1.1.1
        udel:1.1.1;

when you did:
cvs update -j"RELENG2_2:July 1" this_file.

because RELENG_2_2 is 1.2.0.6 which has not diverged,
but 1.2 DOES have a diverged branch, (the 1.2.4 branch).
this made my patch also fail on this file.
Though the -j failure is more important because it is the
failure of an advertised feature.  below find the patch to fix this:


Julian Elischer wrote:
> 
> Dear CVS guru's (and freebsd types CC'd),
> 
> By changing the following change:
>  (big isn't it?)
> the following becomes possible:
> 
> cvs checkout -rMY_BRANCH -D"7 days ago" my-module
> also
> cvs update -rMY_BRANCH -D"May 1" my-module
> is also allowable..
> this seems useful to me
> In fact I desperatly need this..
> 
> does anyone know if this is a reasonable thing to do, (or not?)
> if you are one of the maintainers I'd definitly like to hear from you,
> as if I don't I'll add this change to the FreeBSD CVS mirror,
> as we use many branches and not being able to check
> them out to a past date is a real pain..
> 
> better methods are of course just as welcome,
> e.g. "-rMY_BRANCH:May 1" would work just as well for me.
> 
> julian@freebsd.org
> 
[previous patch removed]

--------------15FB7483794BDF32446B9B3D
Content-Type: text/plain; charset=us-ascii; name="xx"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="xx"

? zlib.h
? zconf.h
? update.c.new
? xx
Index: rcs.c
===================================================================
RCS file: /cvs/freebsd/src/contrib/cvs/src/rcs.c,v
retrieving revision 1.12
diff -u -r1.12 rcs.c
--- 1.12	1997/08/22 06:57:30
+++ rcs.c	1997/09/20 02:18:35
@@ -1857,9 +1857,9 @@
     free (xbranch);
     if (p == vers->branches->list)
     {
-	/* FIXME: This case would seem to imply that the RCS file is
-           somehow invalid.  Should we give an error message?  */
-	return (NULL);
+	   /* This happens when you have a couple of branches off a revision,
+	   and your branch has not diverged, but another has. */
+	return (xstrdup (cur_rev));
     }
 
     p = findnode (rcs->versions, p->key);
Index: update.c
===================================================================
RCS file: /cvs/freebsd/src/contrib/cvs/src/update.c,v
retrieving revision 1.1.1.4
diff -u -r1.1.1.4 update.c
--- 1.1.1.4	1997/06/22 10:55:25
+++ update.c	1997/09/20 02:18:35
@@ -491,7 +491,7 @@
 	&& tag != NULL
 	&& finfo->rcs != NULL)
     {
-	char *rev = RCS_getversion (finfo->rcs, tag, NULL, 1, NULL);
+	char *rev = RCS_getversion (finfo->rcs, tag, date, 1, NULL);
 	if (rev != NULL
 	    && !RCS_nodeisbranch (finfo->rcs, tag))
 	    nonbranch = 1;

--------------15FB7483794BDF32446B9B3D--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?34233657.2781E494>