I find svn branches a bit confusing, because they feel like directories. You specify branches as part of the path to the directory, rather than separately, and it seems that, if a branch doesn’t exist explicitly, some directories don’t show up in trunk (the svn equivalent of SVN’s HEAD). This doesn’t seem useful.
For instance, in maemo, here’s the trunk branch:
But a new directory doesn’t appear there. It’s here instead:
And maemo’s non-trunk branches appear in some strange places, with the branch names in a different part of the path (e.g. haf/gtk+/somebranch/ instead of somebranch/haf/gtk+.):
Is this normal, or is maemo doing something it shouldn’t? When GNOME switches to svn we’ll need a version of GNOME’s great cvs instructions for svn.
8 thoughts on “svn branches are directories?”
Your SVN branches are perfectly OK if they contain the right stuff, and you know which stuff is where. Since branches should be fire-and-forget, it doesn’t matter how they’re named. It would help, though, if they resided in a single place, like /project/branches/… Also, if you pollute the project root with all kinds of folders, it’ll be hard to find stuff there using a SVN browser.
I’m using /trunk, /branches, /people, and /vendor for all projects. /trunk is the trunk (of course) and both /branches and /people contain branches (copies in SVN vocabularity) for shared and personal stuff. /vendor is used for integrating third party software.
svn branches feel like directories because they _are_ directories. Where you put them is completely up to you. There’s nothing special about the name ‘trunk’ or ‘branches’ or ‘tags’. They’re just used by convention to remember how things are organized. When you want to create a new branch, you just copy (svn cp) the current trunk directory to a new directory under ‘branches’ (or however the repository is arranged). So it’s really up to policy to determine how branches are created and used, so GNOME will need to institute some policies like this to prevent any confusion.
Because ‘trunk’ is only a convention, it’s not exactly equivalent to CVS HEAD. You have to explicitly tell it to create the new directory in the ‘trunk’ heirarchy, otherwise it’ll get created exactly where you put it (i.e. at the same level as trunk).
forgot to add: If you really wanted the jhbuild_modules directory to be in the trunk, you can just do a `svn mv https://stage.maemo.org/svn/maemo/projects/haf/jhbuild_modules/ https://stage.maemo.org/svn/maemo/projects/haf/trunk/jhbuild_modules/`
There already is a page about svn ot the gnome developer’s site, and it has been modelled on the current page on cvs: here it is.
The usual layout for a SVN repository is along the lines of:
with branches and tags in
Granted, there is no real difference between a tag and a branch in SVN, it’s just a matter of organization and how you treat it.
Just looking at the layout, a reasonable example is here: http://svn.plone.org/svn/collective/Quills/
In addition to Jonner: you should look at SVN branches as directories-with-a-history.
The main difference between SVN en CVS is exactly that moving or copying files and directories in SVN doesn’t lose the “history” of that file/directory.
I felt that the branches were confusing at first too. Now I love the structure!