Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CVS question

0 views
Skip to first unread message

Archie Cobbs

unread,
Aug 8, 2000, 3:00:00 AM8/8/00
to
Consider this source file:

http://www.freebsd.org/cgi/cvsweb.cgi/src/usr.sbin/xntpd/lib/Attic/ranny.c

Question: what version should this command checkout?

$ cvs co -D 'January 18, 1999 0:00' freebsd/src/usr.sbin/xntpd/lib/ranny.c

Perhaps version 1.1.1.2 would be correct, but instead you get 1.1.
It seems CVS is being inconsistent:

- If you had done a 'head' checkout on that date you would have gotten 1.1.1.2
- If you later do a 'head' checkout, and specify that date, you get 1.1

What am I missing here.. ? Has this behavior in CVS changed at some point?

Thanks,
-Archie

___________________________________________________________________________
Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com


To Unsubscribe: send mail to majo...@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message

John Polstra

unread,
Aug 9, 2000, 3:00:00 AM8/9/00
to
In article <2000080719...@bubba.whistle.com>,

Archie Cobbs <arc...@whistle.com> wrote:
> Consider this source file:
>
> http://www.freebsd.org/cgi/cvsweb.cgi/src/usr.sbin/xntpd/lib/Attic/ranny.c
>
> Question: what version should this command checkout?
>
> $ cvs co -D 'January 18, 1999 0:00' freebsd/src/usr.sbin/xntpd/lib/ranny.c
>
> Perhaps version 1.1.1.2 would be correct, but instead you get 1.1.

CVS is really screwy in this area. I remember I had to add some
special cases to CVSup long ago to try to mimic CVS's behavior in
odd cases.

> It seems CVS is being inconsistent:
>
> - If you had done a 'head' checkout on that date you would have
> gotten 1.1.1.2

That makes sense, because on that date the file had not yet left the
vendor branch, and its default branch attribute still pointed to the
vendor branch.

> - If you later do a 'head' checkout, and specify that date, you get 1.1

CVS has a heuristic that does the wrong thing for this particular
file. The code is around line 3252 of src/contrib/cvs/src/rcs.c in
the function RCS_getdate():

if (! STREQ (cur_rev, "1.1"))
return (xstrdup (cur_rev));

/* This is 1.1; if the date of 1.1 is not the same as that for the
1.1.1.1 version, then return 1.1. This happens when the first
version of a file is created by a regular cvs add and commit,
and there is a subsequent cvs import of the same file. */
p = findnode (rcs->versions, "1.1.1.1");
if (p)
{
vers = (RCSVers *) p->data;
if (RCS_datecmp (vers->date, date) != 0)
return xstrdup ("1.1");
}

It compares the dates on the theory that an import will set
identical dates in revisions 1.1 and 1.1.1.1. But in the file you
mentioned, they are off by 1 second. So CVS doesn't recognize it as
an import.

revision 1.1
date: 1993/12/21 18:36:22; author: wollman; state: Exp;

revision 1.1.1.1
date: 1993/12/21 18:36:23; author: wollman; state: Exp; lines: +0 -0

Probably the import straddled the seconds boundary. I hope current
versions of CVS force the dates to be the same on an import. I
haven't checked to see whether that's the case or not.

John
--
John Polstra j...@polstra.com
John D. Polstra & Co., Inc. Seattle, Washington USA
"Disappointment is a good sign of basic intelligence." -- Chögyam Trungpa

Archie Cobbs

unread,
Aug 10, 2000, 3:00:00 AM8/10/00
to
John Polstra writes:
> > $ cvs co -D 'January 18, 1999 0:00' freebsd/src/usr.sbin/xntpd/lib/ranny.c
> >
> > Perhaps version 1.1.1.2 would be correct, but instead you get 1.1.
>

Hmm.. sounds like we should do one or both of these things..

1/ Fix the bug in CVS that caused the import to set two different dates
2/ Modify this cvs file to set the dates to be the same

What do you think?

-Archie

___________________________________________________________________________
Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com

Nate Williams

unread,
Aug 11, 2000, 3:00:00 AM8/11/00
to
[ CVS has screwy behavior ]

> CVS has a heuristic that does the wrong thing for this particular
> file.

[ Code and discussion deleted ]

> I hope current
> versions of CVS force the dates to be the same on an import. I
> haven't checked to see whether that's the case or not.

Suggestions like this would be good to send to the new CVS maintainers.
Checkout www.cvshome.org, and send in a bug report, if you would
please. You probably know CVS bugs better than many of the
maintainers. :)

Nate

Archie Cobbs

unread,
Aug 11, 2000, 3:00:00 AM8/11/00
to
Nate Williams writes:
> > I hope current
> > versions of CVS force the dates to be the same on an import. I
> > haven't checked to see whether that's the case or not.
>
> Suggestions like this would be good to send to the new CVS maintainers.
> Checkout www.cvshome.org, and send in a bug report, if you would
> please. You probably know CVS bugs better than many of the
> maintainers.:)

Done.

Thanks,
-Archie

___________________________________________________________________________
Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com

0 new messages