Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Jun 2002 20:18:22 +0300
From:      Giorgos Keramidas <keramida@FreeBSD.org>
To:        Makoto Matsushita <matusita@jp.FreeBSD.org>
Cc:        scott@avantgo.com, hackers@FreeBSD.org
Subject:   Re: cvs(1) bug? with cvs update -rX -DY
Message-ID:  <20020629171822.GC5643@hades.hell.gr>
In-Reply-To: <20020626024424P.matusita@jp.FreeBSD.org>
References:  <20020625132020U.matusita@jp.FreeBSD.org> <Pine.LNX.4.44.0206250915150.4336-100000@river.avantgo.com> <20020626022052V.matusita@jp.FreeBSD.org> <20020626024424P.matusita@jp.FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--zhXaljGHf11kAtnf
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

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



--zhXaljGHf11kAtnf
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (FreeBSD)

iD8DBQE9Hevd1g+UGjGGA7YRAlOzAKCAeNQuIiish0IWdQQK+Z68WolAqwCeKXwn
Ygqrax9c2ipAW40hT7QwgaY=
=09Wb
-----END PGP SIGNATURE-----

--zhXaljGHf11kAtnf--

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




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