You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by James Courtier-Dutton <ja...@gmail.com> on 2007/08/09 12:31:55 UTC

Supporting the "Labels" feature of CVS in SVN.

Hi,

Does anyone know how to support the Labels feature from CVS in SVN?

For a repository for documents, we labeled a particular file with
Document version X.
Document version X is not the CVS revision number, it is the version
of the document itself, and this version only changes on a release.
As changes were made to the document, the X label stayed with the file
as the CVS revision number changed, until we had finished the draft at
which point the document is released, and the label on future versions
is then X+1.
We could then retrieve documents individually based on the Label.
We could then also late the current document, and see it's history,
with the labels going back to the first draft.

How does one do this in SVN?

Kind Regards

James

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

Re: Supporting the "Labels" feature of CVS in SVN.

Posted by Erik Huelsmann <eh...@gmail.com>.
On 8/9/07, James Courtier-Dutton <ja...@gmail.com> wrote:
> On 09/08/07, Rainer Sokoll <R....@intershop.de> wrote:
> > On Thu, Aug 09, 2007 at 01:31:55PM +0100, James Courtier-Dutton wrote:
> >
> > Hi,
> >
> > > Does anyone know how to support the Labels feature from CVS in SVN?
> >
> > [...]
> >
> > > How does one do this in SVN?
> >
> > By tagging:
> > http://svnbook.red-bean.com/nightly/en/svn.branchmerge.tags.html
> >
> > Rainer
> >
>
> I have already looked into tagging. It does not do the job.
> I currently use the floating label feature in CVS, and tags do not
> help with that.

You can create floating labels/tags using the mucc (or soon: svnmucc)
utility. It's able to remove and copy in 1 transaction (ie 1 commit):
http://svn.collab.net/repos/svn/branches/1.4.x/contrib/client-side/mucc.c

HTH,

Erik.

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

Re: Supporting the "Labels" feature of CVS in SVN.

Posted by Steven Bakke <st...@amd.com>.
On Aug 9, 2007, at 12:53 PM, Les Mikesell wrote:

> Shawn Talbert wrote:
>> Rather than copies (tagging), could one not use a custom property  
>> to do this
>> [having a "label" attached to multiple versions of the same file]?
>
> Usually the point of the tag is to be able to find the revision you  
> want without checking anything else and with svn's 'cheap copy'  
> method it is a reasonable approach.  The only real down side  
> compared to CVS is that you can't start from a tagged copy and look  
> 'forward' to see what other revisions have been done since this  
> revision was tagged.
>

There are lots of downsides to the SVN method of doing this that I  
believe CVS did better.

1. There is no easy way to determine which versions of a file on your  
trunk or branch are part of any given tag.  Yes, you can mine the  
revision logs in the entire repository to look for copies, but that  
isn't what I would call easy.
2. A property would be great except that you want to apply a property  
to a specific revision.  You can't do this to my knowledge so it  
isn't an option.
3. There isn't an efficient query mechanism for getting property  
info.  I would want to be able to do some arbitrary query to give me  
a bunch of stuff that has an arbitrary set of properties set.  This  
isn't really possible.

The best that can be done at this point is to try to make subversion  
tagging look like labels.  However, it is not a replacement for  
labels.  I think it would be a very useful feature to add to  
subversion say in the 2.0 timeframe.  Sometimes you want a cheap  
copy, but sometimes you really want a label ala CVS or Perforce.

If properties had a robust query mechanism, and you could apply  
properties on arbitrary revisions, then you could change the current  
'svn cp' command to apply a property to each of the source revisions  
that it copied.  This would enable #1 which is really the big thing  
that people like about labels.

-Steve


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

Re: Supporting the "Labels" feature of CVS in SVN.

Posted by Les Mikesell <le...@gmail.com>.
Shawn Talbert wrote:
> Rather than copies (tagging), could one not use a custom property to do this
> [having a "label" attached to multiple versions of the same file]?

Usually the point of the tag is to be able to find the revision you want 
without checking anything else and with svn's 'cheap copy' method it is 
a reasonable approach.  The only real down side compared to CVS is that 
you can't start from a tagged copy and look 'forward' to see what other 
revisions have been done since this revision was tagged.

-- 
   Les Mikesell
    lesmikesell@gmail.com

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

RE: Supporting the "Labels" feature of CVS in SVN.

Posted by Shawn Talbert <st...@exploreconsulting.com>.
Rather than copies (tagging), could one not use a custom property to do this
[having a "label" attached to multiple versions of the same file]?



-----Original Message-----
From: Les Mikesell [mailto:lesmikesell@gmail.com] 
Sent: Thursday, August 09, 2007 8:10 AM
To: James Courtier-Dutton
Cc: Rainer Sokoll; users@subversion.tigris.org
Subject: Re: Supporting the "Labels" feature of CVS in SVN.

James Courtier-Dutton wrote:

>>
>>> Does anyone know how to support the Labels feature from CVS in SVN?
>> [...]
>>
>>> How does one do this in SVN?
>> By tagging:
>> http://svnbook.red-bean.com/nightly/en/svn.branchmerge.tags.html
>>
> 
> I have already looked into tagging. It does not do the job.
> I currently use the floating label feature in CVS, and tags do not
> help with that.
> 

You should be able to get most of the same effect of a floating cvs tag 
by deleting the svn tag and copying in a new one with the same name. 
The delete/create won't be atomic, but it wasn't in cvs either if you 
had more than one file.  The operation only affects the head view of the 
repository, but it should work to let you have scripted operations that 
work against known tag names if that is what you are trying to do.

-- 
   Les Mikesell
    lesmikesell@gmail.com

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

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

Re: Supporting the "Labels" feature of CVS in SVN.

Posted by Les Mikesell <le...@gmail.com>.
James Courtier-Dutton wrote:

>>
>>> Does anyone know how to support the Labels feature from CVS in SVN?
>> [...]
>>
>>> How does one do this in SVN?
>> By tagging:
>> http://svnbook.red-bean.com/nightly/en/svn.branchmerge.tags.html
>>
> 
> I have already looked into tagging. It does not do the job.
> I currently use the floating label feature in CVS, and tags do not
> help with that.
> 

You should be able to get most of the same effect of a floating cvs tag 
by deleting the svn tag and copying in a new one with the same name. 
The delete/create won't be atomic, but it wasn't in cvs either if you 
had more than one file.  The operation only affects the head view of the 
repository, but it should work to let you have scripted operations that 
work against known tag names if that is what you are trying to do.

-- 
   Les Mikesell
    lesmikesell@gmail.com

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

Re: Supporting the "Labels" feature of CVS in SVN.

Posted by James Courtier-Dutton <ja...@gmail.com>.
On 09/08/07, Rainer Sokoll <R....@intershop.de> wrote:
> On Thu, Aug 09, 2007 at 01:31:55PM +0100, James Courtier-Dutton wrote:
>
> Hi,
>
> > Does anyone know how to support the Labels feature from CVS in SVN?
>
> [...]
>
> > How does one do this in SVN?
>
> By tagging:
> http://svnbook.red-bean.com/nightly/en/svn.branchmerge.tags.html
>
> Rainer
>

I have already looked into tagging. It does not do the job.
I currently use the floating label feature in CVS, and tags do not
help with that.

James

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

Re: Supporting the "Labels" feature of CVS in SVN.

Posted by Rainer Sokoll <R....@intershop.de>.
On Thu, Aug 09, 2007 at 01:31:55PM +0100, James Courtier-Dutton wrote:

Hi,

> Does anyone know how to support the Labels feature from CVS in SVN?

[...]

> How does one do this in SVN?

By tagging:
http://svnbook.red-bean.com/nightly/en/svn.branchmerge.tags.html

Rainer

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

Re: Supporting the "Labels" feature of CVS in SVN.

Posted by fj <fj...@effjay.com>.
James Courtier-Dutton wrote:
> Hi,
> 
> Does anyone know how to support the Labels feature from CVS in SVN?
> 
> For a repository for documents, we labeled a particular file with
> Document version X.
> Document version X is not the CVS revision number, it is the version
> of the document itself, and this version only changes on a release.
> As changes were made to the document, the X label stayed with the file
> as the CVS revision number changed, until we had finished the draft at
> which point the document is released, and the label on future versions
> is then X+1.
> We could then retrieve documents individually based on the Label.
> We could then also late the current document, and see it's history,
> with the labels going back to the first draft.
> 
> How does one do this in SVN?
> 
> Kind Regards
> 
> James
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org

Basically, you cannot. You have to do something SVN calls creating a 
"tag", which is just a copy of whatever collection of artifacts you 
would otherwise have labeled in another tool.

e.g. With a tool that uses labels, you might have these two labels 
associated with a particular configuration: "Build20070809-01", and "My 
Great Program v2.0-Final". All your artifacts comprising this 
configuration would likely have still been in their primary directory 
structure.

To do the same with SVN, you'd create a physical copy of all of it in a 
sibling /tags/ directory like so:

/trunk/<all your artifacts>
/tags/Build20070808-01/<copies of all your artifacts for the current 
product release 2.0>
/tags/Build20060503-07/<this might have been one of your previous 
product releases>
/tags/etc...

Note the string 'Build20070808-01' is now a real, physical directory, so 
if you make this terribly long, it'll be very inconvenient to live with 
(paths will get quite long). Alternatively, you could have named your 
tag for your end product main release number. But you cannot do both 
since you're making a real, physical directory, not just creating an 
arbitrary string label that the CM system attaches to a specific 
collection of individual artifact revisions.

That's the gist of the idea. There's a good bit more you'll need to read 
(use the red-bean book) to learn about the flexibility you do have with 
this tagging/directory approach and to learn how to adjust your process 
so you can work with SVN and not find yourself fighting it. You'll also 
want to pay careful attention to the problem of protecting your /tags/ 
from unauthorized and unwanted changes -- important for the same reason 
you wouldn't have wanted your labels and what they're attached to to be 
changed once set.

Regards,
FJ

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