You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by "j.j.green" <j....@shef.ac.uk> on 2006/12/13 21:50:20 UTC
Get tag (not revision) into C & perl programs
Hi
I'm a recent refugee from PRCS and am kind of stuck on a problem.
PRCS has major/minor version keywords which I can get into my
programs easily:
/* $Format: "#define PROJECT_VER_MAJ $ProjectMajorVersion$" $ */
#define PROJECT_VER_MAJ 5
/* $Format: "#define PROJECT_VER_MIN $ProjectMinorVersion$" $ */
#define PROJECT_VER_MIN 39
and then I have my programs print
This is program (version 5.39)
when they operate verbosely. I get that for subversion I need to use
tags to hold the human-readable release-version, and these are
disconnected from the revision. I guess that I will need to do some
scripting in order to get a release version into my C & perl programs.
Im thinking a script that
- pulls a release-version.txt file from the repository
- read and increments the version in that file to "5.30"
- checks the file back in
- checks out a C header and writes the release-version as a #define RELVER
5.30
- checks the file back in
- creates the tagged release as tags/program-5.30
This is OK for C. But I have around 60 perl programs which use the same
PCRS mechanism:
# The version: $Format: my "\$version = \"$ProjectVersion$\";"$
my $version = "5.39";
So this is going to get cumbersome. I've searched around but can't find
a slick way to do this. I've seen the FAQ on getting the revision into C,
but I'm after insertng the *tag*
I'd be most grateful for suggestions
Jim
--
View this message in context: http://www.nabble.com/Get-tag-%28not-revision%29-into-C---perl-programs-tf2816911.html#a7862119
Sent from the Subversion Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Get tag (not revision) into C & perl programs
Posted by Talden <ta...@gmail.com>.
On 12/15/06, Andy Levy <an...@gmail.com> wrote:
> On 12/13/06, j.j.green <j....@shef.ac.uk> wrote:
> >
> > Hi
> >
> > I'm a recent refugee from PRCS and am kind of stuck on a problem.
> > PRCS has major/minor version keywords which I can get into my
> > programs easily:
> >
> > /* $Format: "#define PROJECT_VER_MAJ $ProjectMajorVersion$" $ */
> > #define PROJECT_VER_MAJ 5
> > /* $Format: "#define PROJECT_VER_MIN $ProjectMinorVersion$" $ */
> > #define PROJECT_VER_MIN 39
> >
> > and then I have my programs print
> >
> > This is program (version 5.39)
> >
> > when they operate verbosely. I get that for subversion I need to use
> > tags to hold the human-readable release-version, and these are
> > disconnected from the revision. I guess that I will need to do some
> > scripting in order to get a release version into my C & perl programs.
> > Im thinking a script that
> > - pulls a release-version.txt file from the repository
> > - read and increments the version in that file to "5.30"
> > - checks the file back in
> > - checks out a C header and writes the release-version as a #define RELVER
> > 5.30
> > - checks the file back in
> > - creates the tagged release as tags/program-5.30
> >
> > This is OK for C. But I have around 60 perl programs which use the same
> > PCRS mechanism:
> >
> > # The version: $Format: my "\$version = \"$ProjectVersion$\";"$
> > my $version = "5.39";
> >
> > So this is going to get cumbersome. I've searched around but can't find
> > a slick way to do this. I've seen the FAQ on getting the revision into C,
> > but I'm after insertng the *tag*
> >
> > I'd be most grateful for suggestions
>
> Unlike CVS and some other version control systems, tags in Subversion
> are nothing more than copies. The "difference" is in the significance
> that the user applies to the contents/names in the tags directory.
>
> So, if you want to do this, I think you're looking at doing some
> path-reading and parsing to update the file contents.
For any folder intended solely to be a container for tags or branches
you could set a property indicating it's role.
A script could then walk up to find if it's in a tag or branch...
otherwise it's in the trunk
EG "folder_type" and values "tags_container" or "branches_container"
so in
.../
tags/
releases/
milestones/
releases and milestones would have the property "folder_type" set and
interrogating it would show if it's a tag or a branch. Of course to
populate the file with this information you do still need to write a
script to walk the path interrogating SVN and do token replacement in
the file.
Using this mechanism, identifying if it's a release or a milestone is
equally simple.
--
Talden
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Get tag (not revision) into C & perl programs
Posted by Andy Levy <an...@gmail.com>.
On 12/13/06, j.j.green <j....@shef.ac.uk> wrote:
>
> Hi
>
> I'm a recent refugee from PRCS and am kind of stuck on a problem.
> PRCS has major/minor version keywords which I can get into my
> programs easily:
>
> /* $Format: "#define PROJECT_VER_MAJ $ProjectMajorVersion$" $ */
> #define PROJECT_VER_MAJ 5
> /* $Format: "#define PROJECT_VER_MIN $ProjectMinorVersion$" $ */
> #define PROJECT_VER_MIN 39
>
> and then I have my programs print
>
> This is program (version 5.39)
>
> when they operate verbosely. I get that for subversion I need to use
> tags to hold the human-readable release-version, and these are
> disconnected from the revision. I guess that I will need to do some
> scripting in order to get a release version into my C & perl programs.
> Im thinking a script that
> - pulls a release-version.txt file from the repository
> - read and increments the version in that file to "5.30"
> - checks the file back in
> - checks out a C header and writes the release-version as a #define RELVER
> 5.30
> - checks the file back in
> - creates the tagged release as tags/program-5.30
>
> This is OK for C. But I have around 60 perl programs which use the same
> PCRS mechanism:
>
> # The version: $Format: my "\$version = \"$ProjectVersion$\";"$
> my $version = "5.39";
>
> So this is going to get cumbersome. I've searched around but can't find
> a slick way to do this. I've seen the FAQ on getting the revision into C,
> but I'm after insertng the *tag*
>
> I'd be most grateful for suggestions
Unlike CVS and some other version control systems, tags in Subversion
are nothing more than copies. The "difference" is in the significance
that the user applies to the contents/names in the tags directory.
So, if you want to do this, I think you're looking at doing some
path-reading and parsing to update the file contents.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Get tag (not revision) into C & perl programs
Posted by Martin Scharrer <ma...@madmarty.de>.
Hi,
On Wednesday 13 December 2006 22:50, j.j.green wrote:
> This is OK for C. But I have around 60 perl programs which use the same
> PCRS mechanism:
>
> # The version: $Format: my "\$version = \"$ProjectVersion$\";"$
> my $version = "5.39";
> I'd be most grateful for suggestions
If you just like to have the project version coded as tag, i.e. it's SVN URL
looks like this:
svn://host/project_name/tags/version5.39/...
(Protocol could vary)
then just do something like this:
Set the svn:keywords property to 'URL' to include the URL and write something
like this into your Perl scripts:
my $version = ( '$URL$' =~ m{/tags/version(.*?)/} && $1 );
or
(my $version = '$URL$') =~ s{.*/tags/version(.*?)/.*}{$1};
or
my $version = ( '$URL$' =~ m{/tags/version(.*?)/} ) ? $1 : undef;
The $URL$ is of course expanded in your Perls script.
Drawbacks:
- You need a consistant tagging system
- Works only if you build the checked-out tagged version not a branch or the
trunk
I hope this helps you,
Martin
or some
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: svn:externals problem in checkout
Posted by Bob Hiestand <bo...@gmail.com>.
On 12/14/06, LIRA Olavo <Ol...@gemalto.com> wrote:
> Fetching external item into 'EEBXXX_YYYZZZ\Dev'
> svn: 'EEBXXX_YYYZZZ\Dev' is already a working copy for a
> different URL
> -----------
>
> My svn:externals is: "Dev/ https://repository/trunk/toto"
>
> Where directory Dev already exist in project A, but when I
> change the value to:
> "Dev/temp https://repository/trunk/toto"
> Where temp is not under SVN control, then it works fine.
>
> Is it normal? Is there another way to avoid this kind of
> problem? Should I use something else than svn:externals for this
> situation?
Yes, the directory named by the external directive should not exist in
the current directory. Remove the 'Dev' directory and commit, then
set the external property and update.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: svn:externals problem in checkout
Posted by Mark Clements <gm...@kennel17.co.uk>.
"LIRA Olavo" <Ol...@gemalto.com> wrote in message
news:C851EA3075DC8341BD2A66E40EDF971C01CBDD9D@VGEEXC02.CORP.DS.GEMPLUS.COM..
.
> Yes, I think that it is normal.
> You should not have a directory Dev in >your project A.
> It will be created at checkout time by the svn:externals.
> Just remove your Dev directory from A and it should be OK
Thank you Christophe,
But in my case I also have the Dev directory in both projects,
is there another way to do the link the directories and avoid this kind
of problem?
------------------END QUOTE
Yes - use a different name for the externals directory. Externals can only
point to directories, and those directories musn't exist in the repository.
- Mark Clements
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
RE: svn:externals problem in checkout
Posted by LIRA Olavo <Ol...@gemalto.com>.
Ahhhhh, sure... cool! (How stupid of me not testing this before...)
Thanks a lot! ;-)
Olavo Lira
-----Original Message-----
From: Ryan Schmidt [mailto:subversion-2006d@ryandesign.com]
Sent: Monday, December 18, 2006 2:26 PM
To: LIRA Olavo
Cc: users@subversion.tigris.org
Subject: Re: svn:externals problem in checkout
On Dec 18, 2006, at 12:18, LIRA Olavo wrote:
>> I'm not sure that I realy understand.
>> Your question seems to be "Can I have two directories
>> with the same name at the same place ?".
>> What would you like subversion to do exactly
>> when you checkout your project A ?
>>
>> EEBXXX_YYYZZZ (From Project A)
>> Dev (From Project A)
>> ??? (From Project B svn:externals), it can not be also Dev...
>
> Hi Christophe,
>
> Sorry if I didn't explain may self correctly. Here is another
> try:
>
> EEBXXX_YYYZZZ (From Project A)
> Dev/
> Tools (From Project A)
> Applet (From Project B svn:externals)
> OS (From Project B svn:externals)
> Ext (From Project A)
> Plugin (From Project C svn:externals)
>
> So in order to have the picture above my svn:externals should be:
>
> Dev/ https://svnrepository/ProjectB/Applet
> Dev/ https://svnrepository/ProjectB/OS
> Dev/ https://svnrepository/ProjectC/Plugin
>
> But then I have the error I've shown you because I Project A has
> already the Dev directory.
>
> If svn:externals cannot handle this, do you know another way to
> link directories from different projects?
svn:externals can handle this just fine. But you need to set
svn:externals on the Dev directory of Project A then, not its parent
directory, and the contents of the svn:externals property on the Dev
directory should be as follows:
Applet https://svnrepository/ProjectB/Applet
OS https://svnrepository/ProjectB/OS
Plugin https://svnrepository/ProjectC/Plugin
--
To reply to the mailing list, please use your mailer's Reply To All
function
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: svn:externals problem in checkout
Posted by Ryan Schmidt <su...@ryandesign.com>.
On Dec 18, 2006, at 12:18, LIRA Olavo wrote:
>> I'm not sure that I realy understand.
>> Your question seems to be "Can I have two directories
>> with the same name at the same place ?".
>> What would you like subversion to do exactly
>> when you checkout your project A ?
>>
>> EEBXXX_YYYZZZ (From Project A)
>> Dev (From Project A)
>> ??? (From Project B svn:externals), it can not be also Dev...
>
> Hi Christophe,
>
> Sorry if I didn't explain may self correctly. Here is another
> try:
>
> EEBXXX_YYYZZZ (From Project A)
> Dev/
> Tools (From Project A)
> Applet (From Project B svn:externals)
> OS (From Project B svn:externals)
> Ext (From Project A)
> Plugin (From Project C svn:externals)
>
> So in order to have the picture above my svn:externals should be:
>
> Dev/ https://svnrepository/ProjectB/Applet
> Dev/ https://svnrepository/ProjectB/OS
> Dev/ https://svnrepository/ProjectC/Plugin
>
> But then I have the error I've shown you because I Project A has
> already the Dev directory.
>
> If svn:externals cannot handle this, do you know another way to
> link directories from different projects?
svn:externals can handle this just fine. But you need to set
svn:externals on the Dev directory of Project A then, not its parent
directory, and the contents of the svn:externals property on the Dev
directory should be as follows:
Applet https://svnrepository/ProjectB/Applet
OS https://svnrepository/ProjectB/OS
Plugin https://svnrepository/ProjectC/Plugin
--
To reply to the mailing list, please use your mailer's Reply To All
function
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
RE: svn:externals problem in checkout
Posted by LIRA Olavo <Ol...@gemalto.com>.
> I'm not sure that I realy understand.
> Your question seems to be "Can I have two directories
> with the same name at the same place ?".
> What would you like subversion to do exactly
> when you checkout your project A ?
>
> EEBXXX_YYYZZZ (From Project A)
> Dev (From Project A)
> ??? (From Project B svn:externals), it can not be also Dev...
Hi Christophe,
Sorry if I didn't explain may self correctly. Here is another
try:
EEBXXX_YYYZZZ (From Project A)
Dev/
Tools (From Project A)
Applet (From Project B svn:externals)
OS (From Project B svn:externals)
Ext (From Project A)
Plugin (From Project C svn:externals)
So in order to have the picture above my svn:externals should be:
Dev/ https://svnrepository/ProjectB/Applet
Dev/ https://svnrepository/ProjectB/OS
Dev/ https://svnrepository/ProjectC/Plugin
But then I have the error I've shown you because I Project A has
already the Dev directory.
If svn:externals cannot handle this, do you know another way to
link directories from different projects?
Thanks a lot,
Olavo Lira
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
RE: RE: RE: RE: svn:externals problem in checkout
Posted by Méresse Christophe <ch...@nagra.com>.
> > Yes, I think that it is normal.
> > You should not have a directory Dev in >your project A.
> > It will be created at checkout time by the svn:externals.
> > Just remove your Dev directory from A and it should be OK
>
> Thank you Christophe,
>
> But in my case I also have the Dev directory in both projects,
> is there another way to do the link the directories and avoid
> this kind
> of problem?
I'm not sure that I realy understand. Your question seems to be "Can I have two directories with the same name at the same place ?".
What would you like subversion to do exactly when you checkout your project A ?
EEBXXX_YYYZZZ (From Project A)
Dev (From Project A)
??? (From Project B svn:externals), it can not be also Dev...
Regards,
Christophe
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
RE: RE: RE: svn:externals problem in checkout
Posted by LIRA Olavo <Ol...@gemalto.com>.
> Yes, I think that it is normal.
> You should not have a directory Dev in >your project A.
> It will be created at checkout time by the svn:externals.
> Just remove your Dev directory from A and it should be OK
Thank you Christophe,
But in my case I also have the Dev directory in both projects,
is there another way to do the link the directories and avoid this kind
of problem?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
RE: RE: svn:externals problem in checkout
Posted by Méresse Christophe <ch...@nagra.com>.
> My svn:externals is: "Dev/ https://repository/trunk/toto"
>
> Where directory Dev already exist in project A, but when I
> change the value to:
> "Dev/temp https://repository/trunk/toto"
> Where temp is not under SVN control, then it works fine.
>
> Is it normal? Is there another way to avoid this kind of
> problem? Should I use something else than svn:externals for this
> situation?
Yes, I think that it is normal. You should not have a directory Dev in your project A.
It will be created at checkout time by the svn:externals.
Just remove your Dev directory from A and it should be OK
Regards
Christophe Méresse
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
RE: svn:externals problem in checkout
Posted by LIRA Olavo <Ol...@gemalto.com>.
I'm sorry to ask again, but does someone have any idea to help me with
this? Thanks!
========================================
Olavo Lira
-----Original Message-----
From: LIRA Olavo [mailto:Olavo.LIRA@gemalto.com]
Sent: Thursday, December 14, 2006 12:02 PM
To: users@subversion.tigris.org
Subject: svn:externals problem in checkout
Hello,
I need some help in my design structure in SVN server. I have
project that is composed by other projects, so I have started to use
svn:externals property as the link between projects.
But the problem comes when I try to do a checkout of folders
that belong from project B into an existing folder in project A. It
gives me the following error:
-----------
Fetching external item into 'EEBXXX_YYYZZZ\Dev'
svn: 'EEBXXX_YYYZZZ\Dev' is already a working copy for a
different URL
-----------
My svn:externals is: "Dev/ https://repository/trunk/toto"
Where directory Dev already exist in project A, but when I
change the value to:
"Dev/temp https://repository/trunk/toto"
Where temp is not under SVN control, then it works fine.
Is it normal? Is there another way to avoid this kind of
problem? Should I use something else than svn:externals for this
situation?
Thanks in advance,
==========
Olavo Lira
---------------------------------------------------------------------
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
svn:externals problem in checkout
Posted by LIRA Olavo <Ol...@gemalto.com>.
Hello,
I need some help in my design structure in SVN server. I have
project that is composed by other projects, so I have started to use
svn:externals property as the link between projects.
But the problem comes when I try to do a checkout of folders
that belong from project B into an existing folder in project A. It
gives me the following error:
-----------
Fetching external item into 'EEBXXX_YYYZZZ\Dev'
svn: 'EEBXXX_YYYZZZ\Dev' is already a working copy for a
different URL
-----------
My svn:externals is: "Dev/ https://repository/trunk/toto"
Where directory Dev already exist in project A, but when I
change the value to:
"Dev/temp https://repository/trunk/toto"
Where temp is not under SVN control, then it works fine.
Is it normal? Is there another way to avoid this kind of
problem? Should I use something else than svn:externals for this
situation?
Thanks in advance,
==========
Olavo Lira
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: svn 1.4.2 tells me the it is 1.2.3
Posted by Theo Van Dinter <fe...@kluge.net>.
On Thu, Dec 14, 2006 at 12:08:04AM +0100, LIRA Olavo wrote:
> I'm a newbie in this list and I have installed the svn-win32
> 1.4.2 but when I run the svn --version it shows me:
>
> svn, version 1.2.3 (r15833)
>
> Does any one have a clue of what am I doing wrong?
My guess is that you have multiple versions of SVN installed, likely in
different areas.
--
Randomly Selected Tagline:
"A computer is a stupid machine with the ability to do incredibly smart
things, while computer programmers are smart people with the ability to
do incredibly stupid things. They are, in short, a dangerously perfect
match." - Bill Bryson.
svn 1.4.2 tells me the it is 1.2.3
Posted by LIRA Olavo <Ol...@gemalto.com>.
Hi,
I'm a newbie in this list and I have installed the svn-win32
1.4.2 but when I run the svn --version it shows me:
svn, version 1.2.3 (r15833)
compiled Sep 13 2005, 22:45:22
...
Does any one have a clue of what am I doing wrong?
Thanks a lot,
========================================
Olavo Lira
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org