[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: are directories versioned?

From: Dale Worley <dworley_at_pingtel.com>
Date: 2004-12-29 15:04:36 CET

Subversion does version directories -- the problem is that doesn't mean what
you think it means.

What Subversion does keep track of for a directory are the "properties"
you've attached to the directory, it's permissions, etc.

What Subversion *doesn't* keep track of for a directory are *which files are
in the directory*.

In a given working copy or revision, the set of files in a directory is
simply the set of files in the WC or rev that have names that put them in
that directory.

For example, suppose in rev 10, you have a directory X and a file X/Y, and
in rev 11, you've deleted X/Y. Then in rev 10, X and X/Y exist, and in rev
11, X exists but X/Y does not. Assuming you haven't changed the properties
attached to X, X has not been changed from rev 10 to rev 11 -- but X/Y has.

If you check out rev 10, then your WC contains X and X/Y. If you check out
rev 11, then your WC contains X, which is empty, because your WC does not
contain X/Y.

But if you construct a mixed-revision-level WC, with X at rev 11 and X/Y at
rev 10, your working copy will contain X and X/Y, because X is the directory
in which X/Y lives. If you make a mixed-revision WC with X at rev 10 and
X/Y at rev 11, it will only contain X, because "X/Y at rev 11" is absent.
Doing "svn update -r 10 X" will make X/Y appear, not because it updates X
(which is already at rev 10), but because it is recursive and updates X/Y
(which exists at rev 10) as well.

Using "svn update -r XXX --non-recursive" will let you construct various
complex mixed-revision working copies.

Since "svn log X" lists all revs that change any name under X, it will list
all changes that are visible in a directory X.

Dale

-----Original Message-----
From: erh@swapsimple.com [mailto:erh@swapsimple.com]
Sent: Monday, December 27, 2004 7:30 PM
To: users@subversion.tigris.org
Subject: are directories versioned?

        Judging from the behaviour of various svn commands, it seems that
directories aren't versioned in subversion. It doesn't appear to be
possible to, e.g.:
        revert changes to a directory w/o reverting the changes to its files, or
        get a log of changes to the directory itself

However, I saw some messages on this list that imply that directories
actually _are_ versioned. So, which is it? And, if they are versioned,
how do I do things to the directory itself? Are the above mentioned
operations things that subversion can do, but just haven't been implemented
in the UI yet?

eric

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Dec 29 15:07:12 2004

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.