You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by pm...@users.sourceforge.net on 2003/07/08 07:45:58 UTC
How to have a version file in the wc?
Hello everybody!
I seem to have a temporary (I hope :-) mental block - I just can't think about
which way to go to have a file in my wc, which has it's keywords updated with
every "svn up".
Let's rephrase that.
I have a lot of files in my wc, and instead of marking every file I'd like to
have only one file describing my wc (revision-number-wise).
Now I know that that could make troubles if parts are at another revision than
others - but even in the simple case I'm having trouble.
I created a file with contents "$Rev$", set svn:keywords, committed.
-> it gets "$Rev: 0 $".
rm this file, "svn up" to re-get - now it's ok.
On commits in other parts of my wc it doesn't change - ok.
But if I do a "svn up" at the root of my wc - (which includes the marked file,
of course) - the file doesn't get updated!
What am I doing wrong??
Possibly I should have a post-commit-script?? But that works on the repository
and not on my wc.
Help, please???
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: How to have a version file in the wc?
Posted by Philip Martin <ph...@codematters.co.uk>.
Ben Collins-Sussman <su...@collab.net> writes:
> Philip Martin <ph...@codematters.co.uk> writes:
>
>> pmarek@users.sourceforge.net writes:
>>
>> > I created a file with contents "$Rev$", set svn:keywords, committed.
>> > -> it gets "$Rev: 0 $".
>>
>> That's not right, it should contain the revision of the commit and
>> that cannot be zero. I cannot reproduce your problem.
>
> This bug was fixed post-0.24.2.
I see. I suspect we need some regression tests in this area :)
> pmarek: there is no way to automatically have subversion put the HEAD
> revnum into a file. And I really don't understand why you'd want to
> do it.
I don't think it is HEAD that is wanted. I think this is a request
for a $Current$ keyword, that expands to svn_wc_entry_t.revision, as a
way to get an "svnversion-like" version number without running
svnversion. It would work reasonably well for those who deal with
single revision working copies.
--
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: How to have a version file in the wc?
Posted by Ben Collins-Sussman <su...@collab.net>.
Philip Martin <ph...@codematters.co.uk> writes:
> pmarek@users.sourceforge.net writes:
>
> > I created a file with contents "$Rev$", set svn:keywords, committed.
> > -> it gets "$Rev: 0 $".
>
> That's not right, it should contain the revision of the commit and
> that cannot be zero. I cannot reproduce your problem.
This bug was fixed post-0.24.2.
pmarek: there is no way to automatically have subversion put the HEAD
revnum into a file. And I really don't understand why you'd want to
do it. Even if it were possible, at one moment it might say "rev 423"
and the next moment it might say "rev 424", but who knows what that
means? The file is probably identical in both revisions anyway.
You have two choices:
1. use a real release number, like we do. manually type a release
number into a version.h header, and increase it every once in a
while, when you're ready. the release number has nothing to do
with the global revision number; it has to do with the software's
maturity.
2. have your build system insert the value of `svnversion` into a
script or header file. this is what we do when we build the svn
book.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: How to have a version file in the wc?
Posted by Philip Martin <ph...@codematters.co.uk>.
pmarek@users.sourceforge.net writes:
> I created a file with contents "$Rev$", set svn:keywords, committed.
> -> it gets "$Rev: 0 $".
That's not right, it should contain the revision of the commit and
that cannot be zero. I cannot reproduce your problem.
--
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: How to have a version file in the wc?
Posted by Philip Martin <ph...@codematters.co.uk>.
pmarek@users.sourceforge.net writes:
> - "svn merge -r BASE:HEAD file". That doesn't work, and I don't understand
> why. The error it gives is (subversion 0.24.1)
> svn: a path under revision control is needed for this operation
> svn: svn_client__get_revision_number: need a version-controlled
> path to fetch local revision info.
That's a bug reported recently, BASE doesn't work here. Try using a
number.
> How can I get the current HEAD revision number into this file???
What does this mean? The HEAD revision can change at any time, it can
change during an update. Do you mean the revision to which you
updated? There is no keyword for that.
--
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: How to have a version file in the wc?
Posted by pm...@users.sourceforge.net.
> The file hasn't changed, so it remains at the same revision.
> Rev is a short form of LastChangedRevision.
>
> There isn't a keyword that does what you want. The recommended solution
> is to use 'svnversion' during your build process to populate a file with
> workspace version info.
>
> Or you can just make a copy with a special name and instead use the
> keyword HeadUrl for identification. Assuming that HEAD never changes in
> that copy, of course.
Is it possible to get the current values into a file?
eg. I have a file which changed last in revision 100.
HEAD is at 105.
file includes "$Rev$" and has "svn:keywords" set to "Rev".
I tried the following things:
- update (which says "at revision xxx" but does nothing)
- rm file ; svn update file. That works, but is not what I want - what if
someone changed the file?? I know I could check the status - but that's a
little bit complicated.
- "svn merge -r BASE:HEAD file". That doesn't work, and I don't understand
why. The error it gives is (subversion 0.24.1)
svn: a path under revision control is needed for this operation
svn: svn_client__get_revision_number: need a version-controlled
path to fetch local revision info.
How can I get the current HEAD revision number into this file???
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
RE: How to have a version file in the wc?
Posted by Mats Nilsson <ma...@xware.se>.
Hi.
The file hasn't changed, so it remains at the same revision.
Rev is a short form of LastChangedRevision.
There isn't a keyword that does what you want. The recommended solution
is to use 'svnversion' during your build process to populate a file with
workspace version info.
Or you can just make a copy with a special name and instead use the
keyword HeadUrl for identification. Assuming that HEAD never changes in
that copy, of course.
Hth
Mats
> -----Original Message-----
> From: pmarek@users.sourceforge.net
> [mailto:pmarek@users.sourceforge.net]
> Sent: den 8 juli 2003 09:46
> To: dev@subversion.tigris.org
> Subject: How to have a version file in the wc?
>
>
> Hello everybody!
>
> I seem to have a temporary (I hope :-) mental block - I just
> can't think about
> which way to go to have a file in my wc, which has it's
> keywords updated with
> every "svn up".
>
> Let's rephrase that.
> I have a lot of files in my wc, and instead of marking every
> file I'd like to
> have only one file describing my wc (revision-number-wise).
> Now I know that that could make troubles if parts are at
> another revision than
> others - but even in the simple case I'm having trouble.
>
> I created a file with contents "$Rev$", set svn:keywords, committed.
> -> it gets "$Rev: 0 $".
> rm this file, "svn up" to re-get - now it's ok.
>
> On commits in other parts of my wc it doesn't change - ok.
> But if I do a "svn up" at the root of my wc - (which includes
> the marked file,
> of course) - the file doesn't get updated!
>
> What am I doing wrong??
>
>
> Possibly I should have a post-commit-script?? But that works
> on the repository
> and not on my wc.
>
>
> Help, please???
>
>
>
>
> ---------------------------------------------------------------------
> 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