[Top][All Lists]

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

RE: Qs about renaming directories

From: Jim.Hyslop
Subject: RE: Qs about renaming directories
Date: Mon, 17 May 2004 09:53:50 -0400

Conrad T. Pino wrote:
> > From: Irving Kimura
> > 
> > 1. In the directory renaming section, the cvs docs say
> > 
> >   It is almost always better to move the files in the directory
> >   instead of moving the directory.
Ick, that is rather poorly worded. I'll submit a patch on that to make it

> > 
> > What exactly does this mean?  Does mean that rather than renaming
> > the directory OLD-DIR to NEW-DIR, it is better to create NEW-DIR
> > (leaving OLD-DIR in place), and rename all the files OLD-DIR/* to
> > NEW_DIR/* (thereby leaving OLD-DIR empty, except for OLD-DIR/CVS)?
> Yes, your final statement is the essentially correct.  Try:
Don't forget about tags. See also the thread "What tags to delete when
renaming files?" started yesterday.

> > 2. Right after the sentence quoted above, the documentation says
> > 
> >   If you move the directory you are unlikely to be able to retrieve
> >   old releases correctly, since they probably depend on the name
> >   of the directories.
> > 
> > What does this mean?  Can someone give me an example in which it
> > would not be possible to retrieve old releases correctly?  Is this
> > true even if one uses tags to retrieve older releases?
> It means local working directory contains "CVS" directory that has
> files that contain path information.  Moving directory without the
> corresponding changes to "CVS" files is *trouble* in *all* cases.
While that is a consideration (you must make sure everyone releases then
refreshes their checkouts), the problem is a little more subtle than that.

The repository is designed to retrieve a snapshot of your source code as it
existed at a particular moment in time. Suppose, for example, you have a tag
applied, and the makefile refers to src/. Then you rename src to source.
When you check out the older version, the makefile will still say 'src' -
but that directory no longer exists. The software will not build without
making changes to the checked out version. This defeats much of the purpose
of a source control system.

Renaming directories is seldom a good idea. It is almost always best to add
the new directory, then use 'cvs remove' on all the files in the old
directory. Whether you go to the extent of retaining the history (by copying
the ,v files within the repository) is up to you.

Jim Hyslop
Senior Software Designer
Leitch Technology International Inc. (
Columnist, C/C++ Users Journal (

reply via email to

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