Re: get subversion revision-number in a django-project
"Joseph Heck" <[EMAIL PROTECTED]> writes: > generally invoking "svnversion" is the easiest way to get this. This works only if you are not using an export. What works there also is keyword replacement (LastChangedRevision). Unfortunately you have to change the file that tracks the revision for use in the source code everytime you check something in. You have to explicitely enable keyword replacement in svn. Regards, Frank --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: get subversion revision-number in a django-project
Ok. I was trying something similar and I found that getting ant and svn talking nicely was a hassle. I ended up coming up with another solution that I've never heard of anyone else using that I think makes some sense. Instead of the svn version number, I have my ant build script take the checksum of the js/css file and append it to the url of the file. Every time the file changes, its checksum changes. The nice thing is that ant has a built in checksum command and there's no need for any svn integration, making the whole thing more portable. In the base template: In build.xml: CSS_CHECKSUM I figured I'd throw this out there in case others are looking for alternate solutions. Peace, Udi On Jun 16, 4:52 am, Gábor Farkas <[EMAIL PROTECTED]> wrote: > Udi wrote: > > Mind if I ask why? > > i've got the idea from > here:http://www.thinkvitamin.com/features/webapps/serving-javascript-fast > > the idea is that you serve all your media files (js/css/png/jpg) > at urls that contain for example the svn version number, > like: > > /media/1432/js/form.js > > and you setup your webserver to send such headers along the file > which says that the file does not need to be re-fetched for a very long > time (let's say a year). > > and when you release a new version of your program, > then, because the version-number has changed, all your media-urls change. > but it's much better described in the article. > > btw. for the reference, i abandoned the "svnversion" approach. > it produces some funny version numbers when you use svn:externals, > so i went with "svn info" and extracting the version-number from there. > > and, for now i decided that i will not do it at the startup, but will do > it at release-time (so i will extract the version-number at the > release-time, save it to let's say revision.py, and import it into > settings.py). > > gabor --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: get subversion revision-number in a django-project
Udi wrote: > Mind if I ask why? > i've got the idea from here: http://www.thinkvitamin.com/features/webapps/serving-javascript-fast the idea is that you serve all your media files (js/css/png/jpg) at urls that contain for example the svn version number, like: /media/1432/js/form.js and you setup your webserver to send such headers along the file which says that the file does not need to be re-fetched for a very long time (let's say a year). and when you release a new version of your program, then, because the version-number has changed, all your media-urls change. but it's much better described in the article. btw. for the reference, i abandoned the "svnversion" approach. it produces some funny version numbers when you use svn:externals, so i went with "svn info" and extracting the version-number from there. and, for now i decided that i will not do it at the startup, but will do it at release-time (so i will extract the version-number at the release-time, save it to let's say revision.py, and import it into settings.py). gabor --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: get subversion revision-number in a django-project
I don't know about Gabor, but I actually use it in a dashboard view on my site to know what version of the software is deployed at any given time. Very handy that way. -joe On 6/15/07, Udi <[EMAIL PROTECTED]> wrote: > > Mind if I ask why? > > Udi > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: get subversion revision-number in a django-project
Mind if I ask why? Udi --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: get subversion revision-number in a django-project
generally invoking "svnversion" is the easiest way to get this. i.e. "svnversion ./trunk" return the subversion version # for the directory "trunk". -joe On 6/15/07, David Reynolds <[EMAIL PROTECTED]> wrote: > Gabor, > > On 15 Jun 2007, at 9:18 am, Gábor Farkas wrote: > > > > > hi, > > > > in my project i need to get the svn-revision-number of the project > > somehow. > > > > in other words, i need to be able to find out my project's revision > > number in python > > > > (i am not talking about django's revision-number. i'm talking about my > > own revision number) > > > > > > the best way i could find is to execute "svnversion" and get it's > > output. > > i'm planning to do this in settings.py is there a better way? > > > > How about using pysvn? [http://pysvn.tigris.org/] which I think is > the same as doing apt-get install python-subversion on Debian. These > give you python svn client bindings so you should be able to use that > to find out the revision number. > > Cheers, > > Dave > > -- > David Reynolds > [EMAIL PROTECTED] > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: get subversion revision-number in a django-project
Gabor, On 15 Jun 2007, at 9:18 am, Gábor Farkas wrote: hi, in my project i need to get the svn-revision-number of the project somehow. in other words, i need to be able to find out my project's revision number in python (i am not talking about django's revision-number. i'm talking about my own revision number) the best way i could find is to execute "svnversion" and get it's output. i'm planning to do this in settings.py is there a better way? How about using pysvn? [http://pysvn.tigris.org/] which I think is the same as doing apt-get install python-subversion on Debian. These give you python svn client bindings so you should be able to use that to find out the revision number. Cheers, Dave -- David Reynolds [EMAIL PROTECTED] smime.p7s Description: S/MIME cryptographic signature
get subversion revision-number in a django-project
hi, in my project i need to get the svn-revision-number of the project somehow. in other words, i need to be able to find out my project's revision number in python (i am not talking about django's revision-number. i'm talking about my own revision number) the best way i could find is to execute "svnversion" and get it's output. i'm planning to do this in settings.py is there a better way? thanks, gabor --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---