You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by ha...@ion.no on 2006/07/08 15:49:05 UTC

Special support for tags and branches (was: Tags)

> I really don't want to open this debate again.  :-)   Here's a quick
> summary.
>
> The general feeling among subversion developers is that the 'label'
> technique of tagging (the way CVS does it) is an inferior strategy for
> tagging, because there's no accountability.  In the model you  propose
> (as well as in CVS)  there's no record of anyone creating a label, nor
> is there any record of someone changing the label or deleting it.  In
> the subversion defnition of "tag" (a cheap directory copy), the act of
> tagging is an historical event, recorded forever in the history.  If
> someone deletes or accidentally changes the tag, that's recorded as a
> commit as well.  A label/revpropsimply doesn't provide any of this
> sort of tracking.

You were right. I gather from the emails in this thread that we should
build upon the current Subversion-like tags. And I believe we could agree
on the following 4 principles:

1. A better tagging system must be based on the current Subversion-like tags.

2. We should include branches and 'projects' into the discussion.

3. Clients should be able to locate and identify 'projects', branches and
tags. The need for this is exemplified by Subclipse.

4. The Subversion commands and libraries should be extended to maintain
and use the meta-information provided by (3). This will finally enable us
to simplify typical Use Cases, like tagging the trunk.

Based on these, I have the following ideas:

PROJECTS

A 'Project' directory contains properties for the location of the 'trunk',
'branches' and 'tags' directories. The following properties should be
specified for a Project directory:

1.1.  "svn:project"*

1.2.  "svn:tags-location", with a value of e.g. "/svn/tags@456"

1.3.  "svn:branches-location" with a value of e.g. "/svn/branches@678"

1.4.  "svn:trunk-location" with a value of e.g. "/svn/trunk@234"

*) The property "svn:project" defines a Project directory. The value of it
could be a description of the project, copyright information, contact
information, ...

TAGS

All tag directories below the Project's "svn:tags-location" directory
should have a property "svn:tag", with a value of e.g. "/svn/trunk@1452"
of the source of the tag.

In addition, each tag directory should have a property
"svn:project-location", e.g. with value "/svn@123".

BRANCHES

All branch directories below the "svn:branches-location" directory should
have a property "svn:branch", e.g. with the value "/svn/trunk@1567" for
the source of the branch.

The "svn:trunk-location" directory should have a "svn:trunk" property,
similar to the "svn:branch" property, but the value of "svn:trunk" will
usually be empty.

In addition, each tag directory should have a property
"svn:project-location", e.g. with value "/svn@123".

RESOLUTION OF REFERENCES

Say I want to find the 'diff' between the tag 'version-1.0' and the
current working directory. The following shows how 'version-1.0' could be
resolved to a URL:

1.  "version-1.0" is recognised as a tag.
2.  Walk up the local directory tree until I find a "svn:tag-location".
3.  The value of that property identifies the 'tags' directory.
4.  However, that directory may be located elsewhere in HEAD, so I find
(somehow) the current location of the 'tags' directory.**
5.  To the current tags location, I append "/version-1.0".

**) Is this operation fast?

EXTENDING THE COMMANDS

We need to provide commands that will use and support these properties.
There are some options:

1. Make new commands, e.g. 'svn tag'.

2. Extend the syntax for TARGETs, e.g. "@version-1.0" or
"tag://version-1.0" could expand to
"http://svn.collab.net/repos/svn/tags/version-1.0" based on the Project's
"svn:tags-location".

3.  Extend the current commands with more options, e.g. the option '-t'
could mean the second argument to 'cp' should be interpreted relative to
the tag container directory. So a command could look like "svn cp -t .
version-1.0".

(2) is probably sufficient, but (1) is more flexible.

Håkon Hallingstad

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Special support for tags and branches

Posted by John Peacock <jp...@rowman.com>.
Martin Hauner wrote:
> It's just a convenience function for those that use the subversion layout.
> I don't know if anyone is really using it.

I'm using and it works great!  Expand the project, right click on trunk, 
choose Tag and the requester comes up with the project tag directory 
already selected.

John

-- 
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD  20706
301-459-3366 x.5010
fax 301-429-5748

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Special support for tags and branches

Posted by Danny van Heumen <da...@hccnet.nl>.
hakon@ion.no wrote:
> If the user wants to tag a subdirectory, then that's another Project, as
> per definition of 'Project' (mine and Subcommander's).
That sounds kinda logical.

> The Apache Software Foundation repository uses this technique of 'nested
> Projects'. For example the Project /db/torque has a nested Project
> /db/torque/common.
> 
> But if the user has not setup the subdirectory as a Project, then we
> should give him an error message so he can act on it.
Ok, so we're limiting his action and force him to think about what he's
doing. (Of course not a final limit, because he can always manually 'svn
copy'.)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Special support for tags and branches

Posted by ha...@ion.no.
> hakon@ion.no wrote:
>> Exactly, and that's why the 'tags' location must be per directory. For
>> the
>> above example, there could be the following properties:
>>   /trunk:
>>     svn:tagslocation = /tags
>>     svn:brancheslocation = /branches
>>   /vendor/xercesc/current:
>>     svn:tagslocation = /vendor/xercesc
>>
>> The user could give the URLs to /trunk and /vendor/xercesc/current, and
>> Subcommander could read off the locations for the tags and branches.
> Ok, this sounds good.
>
> Another thing: what should happen when someone selects a subdirectory
> from trunk to tag? Because you've indicated in 'trunk' with the property
> "svn:tagslocation" where tags will be stored, but we haven't done that
> for any subdirectories. (Or have we?)
>
> Do you want an error, tell them that there's no 'svn:tagslocation'
> information available, or should we look in parent directories for
> 'svn:tagslocation', or should we just let the user choose?
>
> (I'm just deepening out the idea a little, because I think we're on the
> right track here.)

If the user wants to tag a subdirectory, then that's another Project, as
per definition of 'Project' (mine and Subcommander's).

The Apache Software Foundation repository uses this technique of 'nested
Projects'. For example the Project /db/torque has a nested Project
/db/torque/common.

But if the user has not setup the subdirectory as a Project, then we
should give him an error message so he can act on it.

Håkon Hallingstad

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Special support for tags and branches

Posted by Danny van Heumen <da...@hccnet.nl>.
hakon@ion.no wrote:
> Exactly, and that's why the 'tags' location must be per directory. For the
> above example, there could be the following properties:
>   /trunk:
>     svn:tagslocation = /tags
>     svn:brancheslocation = /branches
>   /vendor/xercesc/current:
>     svn:tagslocation = /vendor/xercesc
> 
> The user could give the URLs to /trunk and /vendor/xercesc/current, and
> Subcommander could read off the locations for the tags and branches.
Ok, this sounds good.

Another thing: what should happen when someone selects a subdirectory
from trunk to tag? Because you've indicated in 'trunk' with the property
"svn:tagslocation" where tags will be stored, but we haven't done that
for any subdirectories. (Or have we?)

Do you want an error, tell them that there's no 'svn:tagslocation'
information available, or should we look in parent directories for
'svn:tagslocation', or should we just let the user choose?

(I'm just deepening out the idea a little, because I think we're on the
right track here.)

Danny

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Special support for tags and branches

Posted by ha...@ion.no.
>> How do you Martin, as a Subcommander developer, view my suggestion that
>> Subversion should standardize on using properties to locate the tags-
>> and
>> branches- directories, and to use properties to mark a tag (in the tags
>> directory) and a branch (in the branch) directory?
>
> I don't know. Thinking more about it, subversions copy tags offer a lot
> of flexibility and it is not so easy to provide a "simple" interface.
>
> Another example. At work we have a layout that looks something like this:
>
> /tags
>    /2.10.1
>    /2.10.2
>    /2.10.3
> /branches
>    /2.10.x
> /trunk
> /vendor
>    /xercesc
>       /current   "trunk"
>       /2.6.0     "tag"
>       /2.6.1     "tag"
>
>
> The trunk/branches/tags is the standard layout. Branches are made by
> copying
> /trunk to /branches/<name> and tags are made by copying /trunk or
> /branches/<name> to /tags/<name>.
>
> Now the interesting part is the vendor branch. The /current path is
> similar
> to /trunk for the vendor library. New versions are checked in on the
> /current
> path. But the tag for the new version is not placed in the /tags path but
> alongside the /current path (the 2.6.0, 2.6.1). So the destination of a
> tag
> depends on the source of the tag.
>
> So there is no way to handle both tag operations with a single tags
> location.

Exactly, and that's why the 'tags' location must be per directory. For the
above example, there could be the following properties:
  /trunk:
    svn:tagslocation = /tags
    svn:brancheslocation = /branches
  /vendor/xercesc/current:
    svn:tagslocation = /vendor/xercesc

The user could give the URLs to /trunk and /vendor/xercesc/current, and
Subcommander could read off the locations for the tags and branches.

Håkon Hallingstad

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Special support for tags and branches

Posted by Martin Hauner <ma...@gmx.net>.
Hi,

hakon@ion.no wrote:
 > In Subcommander, the user has to write the tags- and branches- URL, in
 > addition to the trunk URL. (Or click on a 'standard project layout' button
 > to choose the common tags/, branches/ and trunk/ layout.)

You don't have to set the urls but it helps when creating new branches
and tags in the most common case.

 > Have you
 > received any feedback on the need to write in the three URLs? Is that why
 > you put in a 'standard project layout'?

It's just a convenience function for those that use the subversion layout.
I don't know if anyone is really using it.

> How do you Martin, as a Subcommander developer, view my suggestion that
> Subversion should standardize on using properties to locate the tags- and
> branches- directories, and to use properties to mark a tag (in the tags
> directory) and a branch (in the branch) directory?

I don't know. Thinking more about it, subversions copy tags offer a lot
of flexibility and it is not so easy to provide a "simple" interface.

Another example. At work we have a layout that looks something like this:

/tags
   /2.10.1
   /2.10.2
   /2.10.3
/branches
   /2.10.x
/trunk
/vendor
   /xercesc
      /current   "trunk"
      /2.6.0     "tag"
      /2.6.1     "tag"


The trunk/branches/tags is the standard layout. Branches are made by copying
/trunk to /branches/<name> and tags are made by copying /trunk or
/branches/<name> to /tags/<name>.

Now the interesting part is the vendor branch. The /current path is similar
to /trunk for the vendor library. New versions are checked in on the /current
path. But the tag for the new version is not placed in the /tags path but
alongside the /current path (the 2.6.0, 2.6.1). So the destination of a tag
depends on the source of the tag.

So there is no way to handle both tag operations with a single tags location.

-- 
Martin

Subcommander 1.1.0 - http://subcommander.tigris.org
a cross platform Win32/Unix/MacOSX subversion GUI client & diff/merge tool.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Special support for tags and branches

Posted by ha...@ion.no.
In Subcommander, the user has to write the tags- and branches- URL, in
addition to the trunk URL. (Or click on a 'standard project layout' button
to choose the common tags/, branches/ and trunk/ layout.) Have you
received any feedback on the need to write in the three URLs? Is that why
you put in a 'standard project layout'?

How do you Martin, as a Subcommander developer, view my suggestion that
Subversion should standardize on using properties to locate the tags- and
branches- directories, and to use properties to mark a tag (in the tags
directory) and a branch (in the branch) directory?

And what do you think of making special commands in Subversion for tagging
and branching, which utilizes the properties.

>>> 3. Clients should be able to locate and identify 'projects', branches
>>> and
>>> tags. The need for this is exemplified by Subclipse
>> I think we should watch out with the word 'project'. Although both tags
>> and branches are our own ideas they have a basis in the SVN Cheap
>> Copies. A 'project' is what someone thinks is a single project. But it's
>> nothing tangible for SVN. I agree that we have such a thing as a
>> 'project' but without a clear definition we could think in different
>> ways.
>> (Probably just like the way we thought differently about tags ;) )
>
> I agree that 'project' is not well-defined. When I used the word 'Project'
> (with capital P) in the original email, I meant the collection of a trunk,
> its branches and its tags. I.e. it is a 'cut' or 'branchpoint' in the
> repository tree you want to tag or branch. This does not necessarily
> correspond to the user's perception of her project.
>
> In this case of Subversion, I like to think of
> "http://svn.collab.net/repos/svn" as the 'project URL'.
>
> But in the case of a /trunk, /tags and /branches layout, there is no
> simple 'Project URL'. If we are to follow other VCS' notion of such a
> 'Project', then the trunk defines the Project, because the branches and
> tags are hidden. This would mean /trunk/svn would be the 'Project URL'.
>
> A 'Project URL' is nice to have, because it defines the location of the
> trunk, tags and branches. So you could pass one URL to a GUI, and it could
> present you with a list of tags, a list of branches, and the immediate
> option of checking out the trunk.

By the way, Subcommander defines a 'project' in the exact same way. (But
Subcommander also puts working copies of the 'branchpoint' into the
project definition.)

Håkon Hallingstad

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Special support for tags and branches

Posted by ha...@ion.no.
>>>> 4. The Subversion commands and libraries should be extended to
>>>> maintain
>>>> and use the meta-information provided by (3). This will finally enable
>>>> us
>>>> to simplify typical Use Cases, like tagging the trunk.
> Please think about a separate application/tool. Because we're actually
> building some sort of a layer around the subversion base. And I don't
> think it is wise to build this directly into subversion itself.

Your wizard should (of course) not be a part of Subversion.

Support for tagging and branching is such an integral part of any VCS, and
every client needs an API to it. Currently the 'copy' interface is used,
but if we are going to make special support for tags and branches the new
interface should be exposed to all Subversion clients.

I have difficulty seeing the "special support for tags and branches"
become a de facto standard, if it is not included in the standard
installation of Subversion.

However, this will all depend on what the list is able to agree on. We
will see.

Håkon Hallingstad

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Special support for tags and branches

Posted by Danny van Heumen <da...@hccnet.nl>.
hakon@ion.no wrote:
> How is the documentation of 'Best Practices' going to make Subversion's
> branching and tagging interface easier? I think you are trying to solve a
> different problem.
It's not ;)

But it is going to make clear to the users that Subversion's branching
and tagging support needs more that just a mouse-click (or a single
command).

And it's not that I'm trying to solve a different problem. It's more
that I'm trying to solve the problem from the roots.
I get the feeling that you're looking solely at the interface of tagging
and branching. I, on the other side, am looking at the complete picture
(interface, directory structure, SVN implementation vs other RCS). I'm
doing this because there were also some mails from people that don't
understand (or don't want to ;) ) why tags and branches are essentially
the same (except for the convention not to change a tag).

But for the sake of progress I'll travel on that little adventure alone
for a while, so I won't hold you up ;).

> I agree that 'project' is not well-defined. When I used the word 'Project'
> (with capital P) in the original email, I meant the collection of a trunk,
> its branches and its tags. I.e. it is a 'cut' or 'branchpoint' in the
> repository tree you want to tag or branch. This does not necessarily
> correspond to the user's perception of her project.
Good point, because I was already thinking in the wrong way.

One difficult point is the fact that some people use this directory layout:

/trunk/{project1}
/trunk/{project2}
/tags/{project1}
/tags/{project2}
/branches/{project1}
/branches/{project2}

(Btw: not talking about 'Project' here, I'm talking about project in the
old form)

The problem you get when you give every project a separate
trunk/tags/branches layout, is that you can't branch several projects.
And this could be necessary if you have project that are dependencies of
each other. (Just so we don't forget about this possible layout.)

> In this case of Subversion, I like to think of
> "http://svn.collab.net/repos/svn" as the 'project URL'.
> 
> But in the case of a /trunk, /tags and /branches layout, there is no
> simple 'Project URL'. If we are to follow other VCS' notion of such a
> 'Project', then the trunk defines the Project, because the branches and
> tags are hidden. This would mean /trunk/svn would be the 'Project URL'.
> 
> A 'Project URL' is nice to have, because it defines the location of the
> trunk, tags and branches. So you could pass one URL to a GUI, and it could
> present you with a list of tags, a list of branches, and the immediate
> option of checking out the trunk.
I agree: we should have some sort of a 'home base' to work from.

>>> 4. The Subversion commands and libraries should be extended to maintain
>>> and use the meta-information provided by (3). This will finally enable
>>> us
>>> to simplify typical Use Cases, like tagging the trunk.
Please think about a separate application/tool. Because we're actually
building some sort of a layer around the subversion base. And I don't
think it is wise to build this directly into subversion itself.

> I am not assuming any particular layout of the repository, I leave that to
> you to document best practices.
Yep, that's my journey :D


Danny

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Special support for tags and branches

Posted by ha...@ion.no.
> hakon@ion.no wrote:
>> You were right. I gather from the emails in this thread that we should
>> build upon the current Subversion-like tags. And I believe we could
>> agree
>> on the following 4 principles:
>>
>> 1. A better tagging system must be based on the current Subversion-like
>> tags.
>>
>> 2. We should include branches and 'projects' into the discussion.
> I "disagree".
> I think the discussion should be _based upon_ the layout of the
> repository not just about Tags (and branches and projects). Tags and
> branches are just part of this layout and AFAICT it's the layout that
> bugs people.
>
> I think that people want to change branching/tagging because they don't
> like the idea of tags and branches being visibly available in their
> repository like other files are. (I think it's a kind of fear the rises
> because 'you can see!' the tag or branch, so it's not a real tag/branch.)
>
> A property isn't directly visible so it makes the concepts 'tags' and
> 'branches' more abstract like they are for example in CVS.
>
> BTW: I get the idea that the fact that you don't check out the root
> folder of a repository scares some people too. (At least some of my
> fellow students insisted on checking out the complete repository every
> time :P, especially those who were used to CVS.)
>
> To get back to the point... I think that we need to document some 'Best
> Practices' of repository layouts that can be used for different scenarios.
> We can use these repository layouts as a base for working towards a tool
> or extension of svn.

How is the documentation of 'Best Practices' going to make Subversion's
branching and tagging interface easier? I think you are trying to solve a
different problem.

>> 3. Clients should be able to locate and identify 'projects', branches
>> and
>> tags. The need for this is exemplified by Subclipse
> I think we should watch out with the word 'project'. Although both tags
> and branches are our own ideas they have a basis in the SVN Cheap
> Copies. A 'project' is what someone thinks is a single project. But it's
> nothing tangible for SVN. I agree that we have such a thing as a
> 'project' but without a clear definition we could think in different ways.
> (Probably just like the way we thought differently about tags ;) )

I agree that 'project' is not well-defined. When I used the word 'Project'
(with capital P) in the original email, I meant the collection of a trunk,
its branches and its tags. I.e. it is a 'cut' or 'branchpoint' in the
repository tree you want to tag or branch. This does not necessarily
correspond to the user's perception of her project.

In this case of Subversion, I like to think of
"http://svn.collab.net/repos/svn" as the 'project URL'.

But in the case of a /trunk, /tags and /branches layout, there is no
simple 'Project URL'. If we are to follow other VCS' notion of such a
'Project', then the trunk defines the Project, because the branches and
tags are hidden. This would mean /trunk/svn would be the 'Project URL'.

A 'Project URL' is nice to have, because it defines the location of the
trunk, tags and branches. So you could pass one URL to a GUI, and it could
present you with a list of tags, a list of branches, and the immediate
option of checking out the trunk.

>> 4. The Subversion commands and libraries should be extended to maintain
>> and use the meta-information provided by (3). This will finally enable
>> us
>> to simplify typical Use Cases, like tagging the trunk.
> If we cover that base correctly and completely we can built tools based
> on this information. I think it's important to have the documentation
> available because we want to learn people why we they should use these
> layouts, and not just automagically generate them or something like that

I am not assuming any particular layout of the repository, I leave that to
you to document best practices.

Håkon Hallingstad

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Special support for tags and branches

Posted by Danny van Heumen <da...@hccnet.nl>.
hakon@ion.no wrote:
> You were right. I gather from the emails in this thread that we should
> build upon the current Subversion-like tags. And I believe we could agree
> on the following 4 principles:
> 
> 1. A better tagging system must be based on the current Subversion-like tags.
> 
> 2. We should include branches and 'projects' into the discussion.
I "disagree".
I think the discussion should be _based upon_ the layout of the
repository not just about Tags (and branches and projects). Tags and
branches are just part of this layout and AFAICT it's the layout that
bugs people.

I think that people want to change branching/tagging because they don't
like the idea of tags and branches being visibly available in their
repository like other files are. (I think it's a kind of fear the rises
because 'you can see!' the tag or branch, so it's not a real tag/branch.)

A property isn't directly visible so it makes the concepts 'tags' and
'branches' more abstract like they are for example in CVS.

BTW: I get the idea that the fact that you don't check out the root
folder of a repository scares some people too. (At least some of my
fellow students insisted on checking out the complete repository every
time :P, especially those who were used to CVS.)

To get back to the point... I think that we need to document some 'Best
Practices' of repository layouts that can be used for different scenarios.
We can use these repository layouts as a base for working towards a tool
or extension of svn.

> 3. Clients should be able to locate and identify 'projects', branches and
> tags. The need for this is exemplified by Subclipse
I think we should watch out with the word 'project'. Although both tags
and branches are our own ideas they have a basis in the SVN Cheap
Copies. A 'project' is what someone thinks is a single project. But it's
nothing tangible for SVN. I agree that we have such a thing as a
'project' but without a clear definition we could think in different ways.
(Probably just like the way we thought differently about tags ;) )

> 4. The Subversion commands and libraries should be extended to maintain
> and use the meta-information provided by (3). This will finally enable us
> to simplify typical Use Cases, like tagging the trunk.
If we cover that base correctly and completely we can built tools based
on this information. I think it's important to have the documentation
available because we want to learn people why we they should use these
layouts, and not just automagically generate them or something like that :D

> Based on these, I have the following ideas:
I think we're rushing a bit here... :P

> 
> PROJECTS
> 
> A 'Project' directory contains properties for the location of the 'trunk',
> 'branches' and 'tags' directories. The following properties should be
> specified for a Project directory:
> 
> 1.1.  "svn:project"*
> 
> 1.2.  "svn:tags-location", with a value of e.g. "/svn/tags@456"
> 
> 1.3.  "svn:branches-location" with a value of e.g. "/svn/branches@678"
> 
> 1.4.  "svn:trunk-location" with a value of e.g. "/svn/trunk@234"
> 
> *) The property "svn:project" defines a Project directory. The value of it
> could be a description of the project, copyright information, contact
> information, ...
> 
> TAGS
> 
> All tag directories below the Project's "svn:tags-location" directory
> should have a property "svn:tag", with a value of e.g. "/svn/trunk@1452"
> of the source of the tag.
> 
> In addition, each tag directory should have a property
> "svn:project-location", e.g. with value "/svn@123".
> 
> BRANCHES
> 
> All branch directories below the "svn:branches-location" directory should
> have a property "svn:branch", e.g. with the value "/svn/trunk@1567" for
> the source of the branch.
> 
> The "svn:trunk-location" directory should have a "svn:trunk" property,
> similar to the "svn:branch" property, but the value of "svn:trunk" will
> usually be empty.
> 
> In addition, each tag directory should have a property
> "svn:project-location", e.g. with value "/svn@123".
> 
> RESOLUTION OF REFERENCES
> 
> Say I want to find the 'diff' between the tag 'version-1.0' and the
> current working directory. The following shows how 'version-1.0' could be
> resolved to a URL:
> 
> 1.  "version-1.0" is recognised as a tag.
> 2.  Walk up the local directory tree until I find a "svn:tag-location".
> 3.  The value of that property identifies the 'tags' directory.
> 4.  However, that directory may be located elsewhere in HEAD, so I find
> (somehow) the current location of the 'tags' directory.**
> 5.  To the current tags location, I append "/version-1.0".
> 
> **) Is this operation fast?
> 
> EXTENDING THE COMMANDS
> 
> We need to provide commands that will use and support these properties.
> There are some options:
> 
> 1. Make new commands, e.g. 'svn tag'.
> 
> 2. Extend the syntax for TARGETs, e.g. "@version-1.0" or
> "tag://version-1.0" could expand to
> "http://svn.collab.net/repos/svn/tags/version-1.0" based on the Project's
> "svn:tags-location".
> 
> 3.  Extend the current commands with more options, e.g. the option '-t'
> could mean the second argument to 'cp' should be interpreted relative to
> the tag container directory. So a command could look like "svn cp -t .
> version-1.0".
> 
> (2) is probably sufficient, but (1) is more flexible.
> 
> Håkon Hallingstad
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Special support for tags and branches

Posted by ha...@ion.no.
>> What happens to these properties under this sort of move?
> ...
> The problem reduces
> to finding out whether "/project1/trunk@100" is a child of "/trunk@45".
> There might be more to this, but I hope it is doable as many commands
> already separate between 'peg' revisions and 'operational' revisions.

I just checked, this is already implemented: the svn_ra_get_locations()
function is able to return the path of a file/directory in revision X,
given its path on a revision Y.

Håkon Hallingstad

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Special support for tags and branches

Posted by ha...@ion.no.
> hakon@ion.no wrote:
>> B) Or, the tag tree is not so simple, exemplified by your 'merge'
>> example,
>> and then the value of "svn:tag" is not well-defined. This change to the
>> value of "svn:tag" has to be done implicitly by the command that is
>> updating the tag.
>>
>> Is case B) a problem for my suggestions? No, because it is a fact of the
>> nature of Subversion-like tags; You cannot generally represent the tag
>> as
>> a simple string in case B), while in case A) it is just path@revision.
>>
>> So in any case, the value of "svn:tag" is _informational_. But if it is
>> given, then a client may use that to, say, draw a graph of the history
>> of
>> 'trunk' and its tags.
> From what I understand 'svn:tag' points to the directory it was copied
> from. Am I correct?

Yes.

> Can't we work with the copy-from-path that is already stored when we're
> creating a copy? I'm not such a fan of introducing a new tag, unless I
> really know we can't solve it any other way.

Oh, I see. We could use that value.

But we still need to mark the copy as a 'tag' operation, and not just some
 copy operation. And so we need the "svn:tag" property, just not its
value.

Now if we already need to get the property "svn:tag", then we got its
value for free. If we instead use the copy-from-path, then that would take
an extra 'log' call (to the repository)...

> Also I don't know if it is wise to separate tags and branches... As Nik
> already pointed out, they're essentially the same thing (at least it is
> the same way in the understanding of subversion).
>
> I think it's kind of powerful that Subversion sees only a copy and we
> see a tag or branch because of the directory structure built around it.
> (This also makes it more tricky of course :P)

We should differentiate between what the user would like Subversion to do
(the public interface), and how Subversion implements those features.

A branch is conceptually where the development of the code happens. A tag
saves a snapshot of the development.*

And so one client may want to draw a history of a branch, and plot in its
tags. In the same graph, the client may or may noy want to also plot the
off-shot branches. Or it may want to draw the branches in a different
color, or it may plot them exactly like tags. We must give the client a
chance to do what they like.

A client may want to show tags which have been altered after their
creation in red, to warn the user of a possible 'code attack'. You do not
want that for a branch.

*) The tag is not a snapshot of a branch when the it is a copy of a
working copy tree. But take Subversion as an example; Its tags are very
close to a URL@revision, as so it might still be said to be a snapshot of
a branch.

Håkon Hallingstad

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Special support for tags and branches

Posted by Danny van Heumen <da...@hccnet.nl>.
hakon@ion.no wrote:
> B) Or, the tag tree is not so simple, exemplified by your 'merge' example,
> and then the value of "svn:tag" is not well-defined. This change to the
> value of "svn:tag" has to be done implicitly by the command that is
> updating the tag.
> 
> Is case B) a problem for my suggestions? No, because it is a fact of the
> nature of Subversion-like tags; You cannot generally represent the tag as
> a simple string in case B), while in case A) it is just path@revision.
> 
> So in any case, the value of "svn:tag" is _informational_. But if it is
> given, then a client may use that to, say, draw a graph of the history of
> 'trunk' and its tags.

Re: Special support for tags and branches

Posted by ha...@ion.no.
> hakon@ion.no wrote:
>> TAGS
>>
>> All tag directories below the Project's "svn:tags-location" directory
>> should have a property "svn:tag", with a value of e.g. "/svn/trunk@1452"
>> of the source of the tag.
>
> This doesn't work.  A tag is just a branch you haven't committed to yet.
>   I have, on rare occasions, copied trunk/ to tags/foo/, and then merged
> a followup commit from trunk/ to tags/foo/ instead of laying down a new
> tag.
>
> "Sliding" tags in this way is an operation that other systems, including
> CVS, support.

The "svn:tag" property serves two purposes.

1. Its presence signals that the directory is a tag. This is unaltered by
your example.

2. Its value should indicate what the tag has tagged. This is affected by
your example.

Let me elaborate on 2).

Tags may be divided into two types, either A) it may be represented by
'path@revision', or B) it must (generally) be represented by the full tag
directory tree. (See the "Tags: What is a tag?" thread for more
information on the two cases A) and B).) Now corresponding to these two
cases:

A) Either you are updating the tag to represent e.g. "/svn/trunk@1454",
and if so the "tag:svn" should be updated with that value. This has to be
done implicitly by the command that is updating the tag. This does not
cover the 'merge' case you described.

B) Or, the tag tree is not so simple, exemplified by your 'merge' example,
and then the value of "svn:tag" is not well-defined. This change to the
value of "svn:tag" has to be done implicitly by the command that is
updating the tag.

Is case B) a problem for my suggestions? No, because it is a fact of the
nature of Subversion-like tags; You cannot generally represent the tag as
a simple string in case B), while in case A) it is just path@revision.

So in any case, the value of "svn:tag" is _informational_. But if it is
given, then a client may use that to, say, draw a graph of the history of
'trunk' and its tags.

Note that if you merge changes onto a tag, then no Subversion client will
be able to plot such a history graph for 'trunk'. It must have some
meta-information that binds a tag to a revision of trunk.

> Also, what happens to these properties if directories are moved around?
>
>    svn mkdir trunk tags branches
>    svn commit -m 'Create normal infrastructure'
>
> ... time passes.  Commits happen under trunk/, trunk/ is copied under
> tags/ multiple times ...
>
> And now the repo needs to support a second project.  So the committer
> does:
>
>    svn mkdir project1
>    svn commit -m 'Place for project1 to live'
>    svn move trunk project1
>    svn move tags project1
>    svn move branches project1
>    svn commit -m 'Move project1 files under project1'
>    svn mkdir project2
>    svn mkdir project2/trunk project2/tags project2/branches
>
> What happens to these properties under this sort of move?

It was designed for allowing refactoring.

1. Properties follow its directory in the 'move'.

2. The property value, e.g. "/trunk@45", will also be safe. It just says
that at revision 45, the directory had path "/trunk". The problem reduces
to finding out whether "/project1/trunk@100" is a child of "/trunk@45".
There might be more to this, but I hope it is doable as many commands
already separate between 'peg' revisions and 'operational' revisions.

Håkon Hallingstad

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Special support for tags and branches

Posted by Nik Clayton <ni...@ngo.org.uk>.
hakon@ion.no wrote:
> TAGS
> 
> All tag directories below the Project's "svn:tags-location" directory
> should have a property "svn:tag", with a value of e.g. "/svn/trunk@1452"
> of the source of the tag.

This doesn't work.  A tag is just a branch you haven't committed to yet. 
  I have, on rare occasions, copied trunk/ to tags/foo/, and then merged 
a followup commit from trunk/ to tags/foo/ instead of laying down a new tag.

"Sliding" tags in this way is an operation that other systems, including 
CVS, support.

Also, what happens to these properties if directories are moved around?

   svn mkdir trunk tags branches
   svn commit -m 'Create normal infrastructure'

... time passes.  Commits happen under trunk/, trunk/ is copied under 
tags/ multiple times ...

And now the repo needs to support a second project.  So the committer does:

   svn mkdir project1
   svn commit -m 'Place for project1 to live'
   svn move trunk project1
   svn move tags project1
   svn move branches project1
   svn commit -m 'Move project1 files under project1'
   svn mkdir project2
   svn mkdir project2/trunk project2/tags project2/branches

What happens to these properties under this sort of move?

N


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org