info-cvs
[Top][All Lists]
Advanced

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

Re: Removing directories...


From: Francis Irving
Subject: Re: Removing directories...
Date: Thu, 22 Feb 2001 10:01:43 +0000

On Wed, 21 Feb 2001 10:45:13 -0000, Smets Thomas
<address@hidden> wrote:

>Question may sound trivial but ...
>If I remove a directory from my local working copy after requesting all
>files to be removed.
>       cd Dir1/TargetDir
>       rm File1 File2 File3
>       cvs delete File1 File2 File3
>       cd ..
>       cvs commit -m "Remove the files : File1 File2 File3"
>       cvs update -P
>
>Now will the TargetDir also be removed from the server ?
>Said otherwise, will the TargetDir be moved into some Attic ?

This is a FAQ.  CVS treats directories in a way that you would not
expect (given how other software works), so it needs explaining.

The easy way to understand it is that CVS only stores files.  It knows
nothing about directories at all - it simply does not store them.

The files can be _in_ directories.  The directory itself is just a
label, and has no history or presence/absence.

Now, the Attic is always within the directory where the removed files
were.  Therefore, in order to have an Attic, the directory has to
still exist.  So TargetDir will _not_ be removed from the server.

However, if you always update with:
        cvs update -d -P
two things happen.

-P means "prune empty directories".  i.e. In your working copy, any
directory which has no files in (at least, no files in this branch and
at this time - it may have deleted files) will be deleted.  This
removes clutter from your working copy.

-d constructs new directories from the repository during the update.
By default, CVS doesn't make any new directories whihc 

I always update with "cvs update -d -P" (TortoiseCVS does this by
default).  There are a few cases where this is undesirable (if you use
exclude when you checkout, for example), but it creates a behaviour
which users seem to understand better.

Francis



reply via email to

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