info-cvs
[Top][All Lists]
Advanced

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

Re: How to detect missing CVS directories


From: Jim Hyslop
Subject: Re: How to detect missing CVS directories
Date: Sun, 26 Feb 2012 21:25:00 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12-02-26 2:09 PM, Arnon Weinberg wrote:
> That answers my question.  Running:
>> //cd// cvs -n commit

I usually use the command "cvs -nq update", which will print a ?
before each file it doesn't know about. The -q option suppresses the
"Processing directory abc" messages, which can hide more important
messages.

> One solution I found is to temporarily rename the containing
> directory:
>> cd .. mv pwd pwd.bak /cvs checkout -A -d ~/directory module/ mv
>> pwd/CVS pwd.bak rm -rf pwd mv pwd.bak pwd

That's only part of what you need to do.

When you checkout to the temporary directory, CVS will populate it
with the current versions in the repository, which may not match the
versions that were checked out at the time the CVS directory was blown
away. CVS will indicate that the developer has modified the file
locally. If the developer then checks in the file, then they will in
fact check in an older version of the file, blowing away the more
recent changes.

After you have restored the CVS directory, you will need to execute
'cvs -nq update' to get a list of all files which CVS thinks have been
modified, then compare each of the files against /earlier/ versions in
the repository. For example, if 'cvs status filename' indicates
revision 1.4, you must compare the file against 1.3 (`cvs diff -r1.3
filename`).


Don't just compare it against the previous version, you must go back
several versions to be sure you have the correct version. If the
"modified" version is identical to an earlier version, then you must
use 'cvs update -C filename' to bring it in sync with the repository.
This will discard local changes, and fetch the current version from
the repository.

The tricky part comes in for files that actually were modified
locally, and which also were checked into the repository. For those
files, you will have to use the 'update -C' command, and manually
re-apply the local modifications.

As Arthur suggested, frequent checkins can mitigate these problems,
but you still need to be aware that they can occur. And, of course,
there is no substitute for training the developers to be more careful
and not delete the CVS directory.

- -- 
Jim Hyslop
Dreampossible: Better software. Simply.     http://www.dreampossible.ca
                 Consulting * Mentoring * Training in
    C/C++ * OOD * SW Development & Practices * Version Management
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9K6XwACgkQLdDyDwyJw+NGWgCcDH1FpxUO0Lb0wICcHsRodOlu
CnAAoJhUwtnis6filT1nsyBxJubGZMf9
=77jX
-----END PGP SIGNATURE-----



reply via email to

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