You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by "Peter N. Lundblad" <pe...@famlundblad.se> on 2005/01/01 20:38:52 UTC
Re: are directories versioned?
On Thu, 30 Dec 2004 erh@swapsimple.com wrote:
> On Wed, Dec 29, 2004 at 02:33:05PM +0100, Peter N. Lundblad wrote:
> > On Mon, 27 Dec 2004 erh@swapsimple.com wrote:
> > > Judging from the behaviour of various svn commands, it seems that
> > > directories aren't versioned in subversion. It doesn't appear to be
> >
> > This is not true. Directories are versioned. Moving a file, committing and
> > checking out an old version of the directory will retain the old filename,
> > for example.
>
> hmm.. ok. I've worked with clearcase a bit and it makes an explicit
> distinction between creating a file ("element" in clearcase-speak) and adding
> it to a directory. Of course, if you commit the file, but revert the change
> to the directory, you end up with an unlinked element in the repository.
Just to avoid further confusion: in svn, revert changes only the working
copy. I don't know CC, but that seems different there. (You can "revert"
changes in the repository by merging changes backwards, but that will keep
the file in old revisions.)
> (which then shows up in a special lost+found directory)
> Is it possible for subversion to fail like that if adding (or moving) a file
> is interrupted halfway through? If so, what happens to the file?
>
A commit can fail (or be interrupted) in the middle. That can give you a
transaction in the repository that is not committed. That transaction can
be inspected (using svnlook) or removed (using svnadmin). A file in a
committed transaction (also known as revision) is identified by a path and
a revision number, so files can't be "unlinked" like you describe for
clearcase.
Hope this clears some things up,
//Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: are directories versioned?
Posted by er...@swapsimple.com.
On Sat, Jan 01, 2005 at 09:38:52PM +0100, Peter N. Lundblad wrote:
> Just to avoid further confusion: in svn, revert changes only the working
> copy. I don't know CC, but that seems different there. (You can "revert"
> changes in the repository by merging changes backwards, but that will keep
> the file in old revisions.)
it's the same in clearcase. The difference is that CC lets you put the
directory commit and the file commit in different transactions (I'm assuming
CC has a similar transaction per user-typed-command as svn) whereas it seems
that svn ensures both operations happen within a single transaction and
svn doesn't let you revert one change without reverting the other also.
> > (which then shows up in a special lost+found directory)
> > Is it possible for subversion to fail like that if adding (or moving) a file
> > is interrupted halfway through? If so, what happens to the file?
> >
> A commit can fail (or be interrupted) in the middle. That can give you a
> transaction in the repository that is not committed. That transaction can
> be inspected (using svnlook) or removed (using svnadmin). A file in a
> committed transaction (also known as revision) is identified by a path and
> a revision number, so files can't be "unlinked" like you describe for
> clearcase.
hmm... that seems to imply that there isn't a separate element (to use
a CC term) object that file changes are applied to. Which means that doing
something like figuring out all the changes that might have happened to an
element is essentially impossible because you'd need to search every version
of every directory looking for any file that refers to the one you are
running the command on. Is that right?
So, I'm guessing that to get the contents of a file svn does a single lookup
like this:
path+rev => file contents (perhaps stored as changes to a different path+rev?)
(and directories are just lists of filenames, a cache in effect)
instead of what I was thinking of:
path+rev => directory object
directory object+filename+rev => element obj (like an RCS file)
element obj+path+rev => file contents
eric
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org