[darcs-users] How to "simulate" CVS vendor branches?

David Roundy droundy at jdj5.mit.edu
Fri Oct 31 12:02:54 UTC 2003


On Thu, Oct 30, 2003 at 01:50:14PM -0500, Sean Russell wrote:
> I think that the critical component here is that SVN doesn't have a concept of 
> a tag.  There is no such thing.  There are just copies of (links to) a 
> directory at a given point in time.  If you change the contents of a 
> directory, it becomes a branch.  Tags and branches are therefore *entirely* 
> conceptual -- there is no native Subversion tagging mechanism.

I guess that is my point--subversion doesn't support tagging or branching.
Because they have a centralized repository, you can safely emulate tagging
and branching in the directory tree, but if they had distributed
repositories, this would lead to nasty problems.

Subversion may not have a concept of a tag, but *people* who use svn do
have such a concept, and it's important to think about those people (who
expect things like not having to resolve conflicts resulting from a tag
operation).

> How does DARCS understand directory renames, in terms of diffs?  I had assumed 
> that DARCS was storing a diff in the form of a DARCS command to perform the 
> rename.  Come to think of it, how does DARCS handle deletes?  Somewhere, in 
> the metadata, the deleted directory and all of the files must still be 
> stored, so that you can get to a particular historical version.  Therefore, 
> doesn't every repository have to have every subdirectory of every patch that 
> has been applied, anyway?

Darcs stores darcs patches, which indicate the change that was performed.
In the case of a rename or delete, it looks like

mv oldname newname
or
rmdir dirname

(except that you can only delete empty directories, so there would also be
a bunch of rmfiles).

As you say, all the historical patches are still there, you have the entire
history of the repository (which includes the subdirectories).

> Again, I don't see that -- architecturally -- there is any difference between 
> supporting subprojects and handling directory and file renames.

The difference is that a subproject is intended to be a mini-repo--i.e. you
can check it out without checking out the rest of the repository.  It means
that there is a boundary between the subdirectory and the superdirectory
which cannot be crossed.  Of course, you can think of any subdirectories as
separate projects, but it isn't be possible to check out only a
subdirectory.

> Actually, I just thought of something.  Why can't I imitate SVN's tagging 
> mechanism?
> 
> If
> 
> 	http://.../myproject/trunk
> 
> and trunk is the actuall DARCS project (IE, myproject/trunk/_darcs), then:
> 
> 	cp myproject/trunk myproject/sometag
> 
> is equivalent to an SVN tag, except that you have to do it on the server, 
> which means that you can't push a tag.

Yeah, except that then tagging is expensive.  In effect, that is how
branching is done.  Except that in either case you're much better off using
darcs get to do the copy, since it'll then make hard links and save you a
lot disk space (besides being faster than a cp).
-- 
David Roundy
http://www.abridgegame.org




More information about the darcs-users mailing list