On 2002-06-26 02:44 +0000, Makoto Matsushita wrote:
>
> scott> You could simply pop up a couple directories and checkout the
> scott> given tag and date over your existing checkout.  CVS is smart
> scott> enough to notice that you've already got something checked out,
> scott> and it will just update things.
>
> matusita> It would be fine to me.  Thank you.
>
> Hmm, my cvs(1) doesn't allow me to checkout.
>
> % rm -rf src
> % cvs -R -d /home/ncvs checkout -rRELENG_4 -D"Wed Jun 26 00:00:00 JST 2002" 
>src/contrib/lukemftpd
> cvs checkout: Updating src/contrib/lukemftpd
> cvs checkout: Updating src/contrib/lukemftpd/src

Nope.  You have to do this in two steps.  First you checkout the files
from the proper branch with -r BRANCH_TAG.  This makes the branch 'sticky'
and subsequent 'update' operations assume the same branch, unless -A
is specified.  See the transcript shown below.

        % cd /tmp
        % cvs -R -d /home/ncvs co -r RELENG_4 -l src
        cvs checkout: Updating src
        U src/COPYRIGHT
        U src/Makefile
        U src/Makefile.inc1
        U src/Makefile.upgrade
        U src/README
        U src/UPDATING
        % cd src
        % cvs -q up -APdl bin
        U bin/Makefile
        U bin/Makefile.inc
        % cd bin
        % cvs -q up -APd cat
        U cat/Makefile
        U cat/cat.1
        U cat/cat.c
        % cd cat

Let's see what the one before the last commit was to the cat.c file.

        % ident cat.c
        cat.c:
             $FreeBSD: src/bin/cat/cat.c,v 1.14.2.7 2002/04/24 13:36:45 asmodai Exp $

The 1.14.2.6 revision was created (as you can verify with `cvs log')
shortly before -D '2002-04-24 13:34:00 UTC'.  Let's update to that
date, or at least attempt to:

        % cvs -q up -Pd -D '2002-04-24 13:34:00 UTC' cat.c
        U cat.c
        % cvs stat cat.c
        ===================================================================
        File: cat.c             Status: Up-to-date

           Working revision:    1.21    Sat Jun 29 17:12:00 2002
           Repository revision: 1.21    /home/ncvs/src/bin/cat/cat.c,v
           Sticky Tag:          (none)
           Sticky Date:         2002.04.24.13.34.00
           Sticky Options:      (none)

Nope.  Not quite.  This is the HEAD revision of the file.  Let's see if both a
branch AND a date can be specified:

        % cvs -q up -Pd -rRELENG_4 -D '2002-04-24 13:34:00 UTC' cat.c
        U cat.c
        % cvs stat cat.c
        ===================================================================
        File: cat.c             Status: Needs Patch

           Working revision:    1.14.2.6        Sat Jun 29 17:12:15 2002
           Repository revision: 1.14.2.7        /home/ncvs/src/bin/cat/cat.c,v
           Sticky Tag:          RELENG_4 (branch: 1.14.2)
           Sticky Date:         (none)
           Sticky Options:      (none)

Note that cat.c has a sticky tag of RELENG_4 but the working revision
is identical to 1.14.2.6 and not 1.14.2.7 which is the latest revision
in the RELENG_4 branch :-)

So, the proper steps to get the files of a branch other than HEAD, in
the revisions they had at a certain point in time would be:

        + Checkout using the branch as a sticky tag.
        + Update using both -D DATE and -r BRANCH_TAG.

I hope this helps a bit...

- Giorgos


Attachment: msg35386/pgp00000.pgp
Description: PGP signature

Reply via email to