bug-cvs
[Top][All Lists]
Advanced

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

Re: cvs doesn't checkout correct revision in vendor branch with -D date


From: FUJISHIMA Satsuki
Subject: Re: cvs doesn't checkout correct revision in vendor branch with -D date
Date: Wed, 29 Nov 2000 01:18:41 +0900
User-agent: Wanderlust/2.5.1 (Smooth) SEMI/1.13.7 (Awazu) FLIM/1.13.2 (Kasanui) Emacs/20.7 (i386--freebsd) MULE/4.1 (AOI)

At Tue, 28 Nov 2000 20:29:51 +0900,
KOIE Hidetaka wrote:
>   | $ cvs co -D'11/12/2000 11:01:00 UTC' test
>   | cvs checkout: Updating test
>   | U test/VERSION
>   | $ cat test/VERSION 
>   | VERSION2
>   | ### This is correct. ###
>   | 
>   | $ rm -r test
> 
> Did you remove the directory?

I think you meant "the directory" ./test created with cvs checkout.
Yes, current directory is always swept away before checkout.

> CVS resets a default branch to commit a imported file.
> (Try "cvs log -h VERSION | grep branch:")
> When using -D option, you can not specify a branch.
> So, the result you get is legal.

No. This is the special case defined in src/rcs.c and it has a bug.

--- src/rcs.c:
    if (cur_rev != NULL)
    {
        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");
        }
    }
---

What is the purpose to compare between revision 1.1.1.1's date and
specified date via -D option? Apparently it should be 1.1.1.1 and 1.1.

The mechanism working on this file should be:
a) head is rev 1.2.
b) going back to the specified date, rev 1.1 is the target.
c) rev 1.1? this is special case. comparing 1.1 and 1.1.1.1. Actually
   rev 1.1 seems having been created via cvs import, try to track on
   vendor branch.
d) rev 1.1.1.2 is suitable here, done.

This bug causes (c) does not work. Then cvs always gives us rev 1.1.

-- 
FUJISHIMA Satsuki

>cvs importしたあとにcvs commitすると
>RCSファイルのデフォルトブランチ属性がリセットされます。そのため、
>cvs commit前にcheckoutするとベンダーブランチから取り出されますが、
>commit後はトランクからになります。
>
>そして-Dオプションを指定した場合は
>トランクから日時の条件に合うものを探してくることから
>あの結果は、いちおう仕様通りということになると思います。

CVSでRCSファイルのdefault branchが使われるのはvendor branchしか存在し
ないファイルの場合だけですよね.そしてTrunkへのcommitによってdefault
branchがクリアされた場合にも,vendor branchを特別扱いするための処理が
src/rcs.cにはあります.

o Trunkから探した結果rev 1.1を返すことになった場合,
o rev 1.1と rev 1.1.1.1の日付を比較し,
o 同じならば rev 1.1は cvs importによって生まれた rev 1.1.1.1の影だと
  して,vendor branchから指定された日付のrevisionを返す
o 違うならば rev 1.1は cvs commitによって生まれ,rev 1.1.1.1はそれとは
  別の importによって生まれたので,vendor branchは追わず rev 1.1を返す

というのが期待された動作ですが,実際には関係ないものを比較してしまって
いるので,常に rev 1.1が返されるのです.

reply via email to

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