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

Re: Can't check out single file from branch - svn client bug?

From: Dirk Schenkewitz <schenkewitz_at_docomolab-euro.com>
Date: 2005-05-06 16:24:27 CEST

I just had a weird idea, so weird that I hardly dare to CC it to the list.

David Faure wrote:
> On Friday 06 May 2005 02:29, Ben Collins-Sussman wrote:
>>On May 5, 2005, at 5:47 PM, David Faure wrote:
>>>Now, I want file.cc and file-in-branch.txt together in this directory.
>>Sorry, not possible.
>>A working copy must resemble a tree somewhere in the repository. It's
>>okay for parts of the tree to reflect disjoint sections of the
>>repository, but you cannot invent arbitrary tree-structures, "merge"
>>directory contents together, etc.
>>That said, there's no reason we couldn't add this ability; it probably
>>wouldn't be too much of a stretch. But honestly, nobody's ever asked
>>for this feature before. What you're trying to do is rather unusual:
>>normally branches tend to have similar structures, so you just switch
>>an existing chunk of working-copy structure to reflect some analogous
>>structure on the branch. In the rare case, say, where the branch has
>>an extra directory that your working copy doesn't, you can always do an
>>extra 'svn checkout" of that directory. But you can't checkout a
>>single file, hence you're stuck.
> I don't think there's anything so "unusual" there. Branches might have
> similar directory structure, they don't necessarily have the exact same
> set of files.
> In case you're wondering why I was looking for this feature:
> it was perfectly possible with CVS. This is how we handled the development
> for a customer who wanted additional features on top of an opensource
> project's stable branch. The rules of the project forbid new features in stable
> branches, so we had to branch it. But if we branched the whole project, then
> we would have to merge manually any bugfix done in the stable branch.
> Instead, by only branching the minimum set of files that we needed to change,
> we could benefit automatically from any bugfix in the stable branch. We still
> have to manually merge fixes made to the few files we branched, but
> that's much less work.
> So with CVS we simply had a script to "switch" a set of files (and sometimes
> directories). Porting this to SVN I realize that SVN doesn't allow me to do that...
> I guess I'll branch entire directories for now, but I don't see why future versions
> of the svn client shouldn't be able to do this :)

Would the following work, maybe? I did not try to do it:

Have the main development on the /trunk. Make a branch for the additional
features, say /branches/special. There, do 'svn delete' for all files
that you want to inherit from the /trunk, then (inside /branches/special)
create symbolic links, like 'ln -s ../../trunk/file1 file1' and so on.

Here I'm unsure:
Can SVN deal properly with relative symlinks? If yes, good.
Can it happen that this may checked out on windows (which doesn't know
about symbolic links)? If no, very good. Commit the replacing of regular
files by symlinks.
 From now on you don't have to worry about updates on trunk, you always see
the newest files via the symlinks. You only need to take care about all
regular files within /branches/special.
Disadvantage: Everybody needs to have /trunk and /branches/special together,
or the symbolic links become broken.

Still, this is probably a Bad Hack that works around the sense of SVN.

Anyway, have fun

To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri May 6 16:35:00 2005

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.