You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Sean Moss-Pultz <se...@moss-pultz.com> on 2004/03/29 03:34:00 UTC

script to put svn revision number in c source file

I want to have the revision number automatically written to a source 
file after a successful commit.  This will then be used in a c program. 
I've searched the archives and something like this:

svn status -Nqu

was suggested before. This will work for what I need but I'm not sure 
where (and when) is the best place to execute the code. I'm running 
1.01 on Windows 2k Server. Has anyone done this before?

Any guidance would be greatly appreciated.

Thanks!

-Sean


Re: script to put svn revision number in c source file

Posted by jalal <th...@fastmail.fm>.
On Mon 29 March 2004 11:19, Sean Moss-Pultz wrote:
> On Mar 29, 2004, at 5:11 PM, jalal wrote:
> > Won't svn:keywords work for you???
>
> I think it will. My question is really "how" to implement this and from
> where. For example, should it be in a post-commit hook or done on the
> client side, etc...?
>
> The post-commit hook seems troubling for me because if a client wanted
> to do a diff immediately after a commit there would not have the same
> file content as the server.
>

Hmm, I think it is already implemented. By including the '$Rev$' tag in a file 
that is under svn and having keywords turned on for that file, the $Rev$ tag 
will be replaced by the revision number.
Assuming I've understood what you want... :)

jalal

-- 

GPG fingerprint = 3D45 5509 D380 26A4 523E  A9D8 A66A 5F38 CA43 BB0E


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

Re: script to put svn revision number in c source file

Posted by Sean Moss-Pultz <se...@moss-pultz.com>.
On Mar 29, 2004, at 5:11 PM, jalal wrote:

> Won't svn:keywords work for you???

I think it will. My question is really "how" to implement this and from 
where. For example, should it be in a post-commit hook or done on the 
client side, etc...?

The post-commit hook seems troubling for me because if a client wanted 
to do a diff immediately after a commit there would not have the same 
file content as the server.

Thanks!

-Sean



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

Re: script to put svn revision number in c source file

Posted by jalal <th...@fastmail.fm>.
On Mon 29 March 2004 05:34, Sean Moss-Pultz wrote:
> I want to have the revision number automatically written to a source
> file after a successful commit.  This will then be used in a c program.
> I've searched the archives and something like this:
>
> svn status -Nqu
>
> was suggested before. This will work for what I need but I'm not sure
> where (and when) is the best place to execute the code. I'm running
> 1.01 on Windows 2k Server. Has anyone done this before?
>
> Any guidance would be greatly appreciated.
>
> Thanks!
>
> -Sean

Won't svn:keywords work for you???

-- 

GPG fingerprint = 3D45 5509 D380 26A4 523E  A9D8 A66A 5F38 CA43 BB0E


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