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

Re: Feature request: Keyword $Rev$ with a twist

From: Josef Wolf <jw_at_raven.inka.de>
Date: 2002-08-01 00:02:23 CEST

On Wed, Jul 31, 2002 at 11:49:09AM -0500, Ben Collins-Sussman wrote:

> I think that we've all agreed that we don't want to put the
> working-rev into our Subversion's *own* svn_version.h header. But I
> don't think anyone is particularly against the creation of a
> $WorkingRev$ keyword.
>
> We don't want to use this technique in our own header because it might
> lead to a lot of confusion: first, as you say, there's the
> possibility of a mixed-rev working copy. But then also, what if
> somebody checks out the latest fs-convert-2092 branch from HEAD?
> Well, then you'll have a "2092 branch binary" that claims to be at
> revision 2805 or something... big confusion.

Having used CVS for about 10 years now, I still have no clue why you
all want those mixed-revs-stuff. Maybe someone could give me a good
use case?

(WARNING: the rest of this posting is heavy politics. I don't expect
          anyone to agree with those sayings)

Anyway, I think all this heavily depends on the politics you want to
run on your project. Just for example: I run the policy to never
release versions which are not tagged. When you agree on such a policy
for your project, then HeadURL contains everything you need. This has
also the advantage that you are not limited to the (internal,
auto-generated) svn revision but can get version strings like V0.14.0
just by doing:

  $vers = $HeadURL$;
  ($version) = $vers=~m!http://svn.collab.net/repos/svn/tags/([^/]+)!;
  print qq!# define VERSION "V$version"\n!;

then you could put into your makefile:

 version.h: version.pl
            perl perlsion.pl >version.h

I have not tried this yet, but this shows the idea I am planning to
setup my projects. Of course there are some issues when the URL is
changed for some reason. But for now I dont want to go too much into
implementation details, just show the general idea.

> But hey, if others want to use a $WorkingRev$ keyword for whatever
> reason, then I'm +0 on adding that feature.

I would prefer some variant of HeadURL where the URL-Prefix is
stripped off so that the perl-match mentioned above would be less
prone to changes in the repository location. But I am not really
convinced that such a keyword is really needed, because you could
minimize those problems with:

  ($version) = $vers=~m!/svn/tags/([^/]+)!;

You could even extend this to something like this:

  $vers = $HeadURL$;
  if ($vers=~m!/trunk/!) {
    print "WARNING: you are using an inofficial snapshot!\n";
  } elsif ($vers=~m!/branches/([^/]+)!) {
    print "WARNING: Do you really want to be on HEAD of $1?\n";
  } elsif ($vers=~m!/tags/([^/]+)!) {
    print "You use version $1, that's OK!\n";
  }

Just my Eur 0.02 ;-)

-- 
-- Josef Wolf -- jw@raven.inka.de --
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Aug 1 00:03:54 2002

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.