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

Re: Subversion Doesn't Have Branches aka Crossing the Streams aka Branches as First Class Objects?

From: Branko ÄŒibej <brane_at_wandisco.com>
Date: Sun, 19 May 2013 11:17:57 +0200

On 19.05.2013 11:08, Zé wrote:
> On 05/19/2013 09:51 AM, Zé wrote:
>>
>> Again, the problem is that subversion does not support branches or tags.
>> All it supports is basic file operations on a file system, and they
>> are not adequate for simulating branches or tags.
>
> Regarding tags, there's a better way to handle them in subversion:
>
> 1) Here's the repo status:
>
> $ pwd
> /tmp/working_copy/trunk
>
> ze_at_ubuntu:trunk$ svn log --limit 3
> ------------------------------------------------------------------------
> r6 | ze | 2013-05-19 09:58:38 +0100 (Sun, 19 May 2013) | 1 line
>
> Marked v2
> ------------------------------------------------------------------------
> r5 | ze | 2013-05-19 09:56:55 +0100 (Sun, 19 May 2013) | 1 line
>
> Marked v1
> ------------------------------------------------------------------------
> r1 | ze | 2013-05-19 09:35:25 +0100 (Sun, 19 May 2013) | 1 line
>
> Initial import
> ------------------------------------------------------------------------
>
> 2a) This might be an alias to a "svn tag checkout v1"
>
> $ svn checkout -r5 file:///tmp/repository/trunk wc
> D wc/this_repo_state_would_be_v2.txt
> A wc/this_repo_state_would_be_v1.txt
> Checked out revision 5.
>
> 2b) This might be an alias to a "svn tag checkout v2"
>
> $ svn checkout -r6 file:///tmp/repository/trunk wc
> A wc/this_repo_state_would_be_v2.txt
> A wc/main.c
> Checked out revision 6.
>
>
> These would be proper tags: they are immutable, they take over
> essentially zero space in the repository, don't store redundant
> information, and are completely free to be created and deleted. No
> network traffic is needed.
>
> I suspect that the only thing that would be needed for subversion to
> offer proper support for tags is to implement a list that tracked
> label names, revision number and the path to a specific subdir tracked
> by the subversion repository.

Your suspicions have led you astray. A tag should also be a
version-controlled object like any other. What you describe are aliases
for path_at_revision, which is not the same thing. Furthermore, to fit
Subversion's model, tags must be identifiable by URLs (just like every
other versioned object in a Subversion repository).

There are better ways to implement immutable tags in Subversion (we've
been considering at least three different approaches), and what you
propose isn't one of them.

-- Brane

-- 
Branko ÄŒibej
Director of Subversion | WANdisco | www.wandisco.com
Received on 2013-05-19 11:18:43 CEST

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.