[Top][All Lists]

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

-D switch partially broken

From: Ohman Staffan
Subject: -D switch partially broken
Date: Thu, 10 Jan 2002 10:50:32 +0200 (EET)

Hmm... something similar to this didn't make it all the way to the list,
here we go again...

>Submitter-Id:   net
>Originator:     Staffan Ohman
>Organization:   net
>Confidential:   no
>Synopsis:      -D switch partially broken
>Severity:      serious
>Priority:      medium
>Category:      cvs
>Class:         sw-bug
>Release:       1.11.1p1
System: FreeBSD foo.bar 3.5.1-RELEASE FreeBSD 3.5.1-RELEASE #1: Thu Apr 5
12:13:15 EEST 2001 sohman@foo.bar:/usr/src/sys/compile/FOO i386

If a file has been imported several times and then some change has been
committed on the main branch an attempt to retrieve any of the imported
versions after the first one but before the "local" change (revision 1.2)
will result in the first version being returned.
Import two versions of a file that previously didn't exist in your
repository. Check out the last one, make some changes and commit.
Then pick a time between the second import and the version you just
committed. (note that cvs log shows the time in GMT but you should use
local time for -D switch) Check out the file using -D and the time you
picked. You will get the first imported version even though the last
version on the main branch at that time was the second imported
version (
The comments starting at line 2873 are right but they have been
incorrectly implemented in the if statement on line 2882.
Instead of comparing the date of to the date of 1.1,
the date of is being compared to the date the user asked for.
One way of fixing this is the patch below:

Index: rcs.c
*** rcs.c
--- rcs.c
*** 2822,2828 ****
--- 2822,2830 ----
      char *cur_rev = NULL;
      char *retval = NULL;
      Node *p;
+     Node *p_1_1;
      RCSVers *vers = NULL;
+     RCSVers *vers_1_1 = NULL;

      /* make sure we have something to look at... */
      assert (rcs != NULL);
*** 2879,2885 ****
        if (p)
            vers = (RCSVers *) p->data;
!           if (RCS_datecmp (vers->date, date) != 0)
                return xstrdup ("1.1");
--- 2881,2889 ----
        if (p)
            vers = (RCSVers *) p->data;
!           p_1_1 = findnode (rcs->versions, "1.1");
!           vers_1_1 = (RCSVers *) p_1_1->data;
!           if (RCS_datecmp (vers->date, vers_1_1->date) != 0)
                return xstrdup ("1.1");

reply via email to

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