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

RE: Revisiting: Question about "labeling" functionality

From: Dale Worley <dworley_at_pingtel.com>
Date: 2005-01-20 15:43:40 CET

I'm not exactly sure what you want to accomplish with "labelling" (and I
haven't read this thread entirely). But it might help to back off from the
*appearance* that the tools present and focus on what you're really trying
to accomplish.

For instance, the standard Subversion tagging tricks work just fine for
keeping track of "the version of foo.c that is labelled 1.2.3". And if you
want to check out all the files that have a certain label, it works
excellently. You can revise which version of a file has a certain label by
a suitable "svn copy". The only place where things are functionally
different (from say the CVS label model) is if you have a labelled version
of some file in your WC and you try to edit it. If it's checked out from a
tag directory, you can do so.

Perhaps you want to write some scripts.

For instance, you could implement "svn-label-file label file" as

URL_DIR=$(svn info . | sed -e '/URL:/!d' -e 's/^URL: //')
LABEL_DIR=$(echo $URL_DIR | sed -e "s#/rep/#/rep/labels/$label/#")
REV=$(svn info . | sed -e '/Revision:/!d' -e 's/^Revision: //')

svn copy $file $LABEL_DIR/$file
svn propset label:rev $REV $LABEL_DIR/$file

That stores the selected version of the file under the "labels/$label"
branch of the source tree.

And you could retrieve a version with "svn-label-select label file" as

URL_DIR=$(svn info . | sed -e '/URL:/!d' -e 's/^URL: //')
LABEL_DIR=$(echo $URL_DIR | sed -e "s#/rep/#/rep/labels/$label/#")
REV=$(svn propget $LABEL_DIR/$file)

svn switch -r$REV $file


To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Jan 20 15:46:32 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.