Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

Build Versioning Plugin

<< < (2/3) > >>

thomas:
My capability of reading perl scripts without getting fits of agony is limited (at least you are one of the few perl programmers that know that the language actually supports line breaks and indentation :) ), so please be patient with me if I don't understand correctly what it's doing. ;)

Isn't it that this script opens a source file, parses it line by line, and fills in the revision number that it got from svn?

That's exactly what keyword substitution does. However, keyword substitution is portable and reliable, unlike all home-made implementations.

If you regularly read the forums, then you'll have read how much pain we are having with the autorevision tool. This is another home-brewn tool doing stuff that actually the revision control system should do, and would probably do better in many places.
The reason why I made autorevision in the first place was that we wanted to have one revision number for the whole project which is the latest revision of all files. Keyword substitution takes the per-file revision number (as your tool does, too), which is unluckily not the best thing to use for displaying a revision number in the about box (to work around, one would have to mark one file dirty in every commit, but that's even worse!).
Also, autorevision provides a fallback functionality for users who don't have svn installed, which is causing more problems than it is actually worth (because of localisation/languages/encodings).

All in all, I can only say that there are many good reasons for using keyword substitution, and few good reason to use anything else. And if you use anything else, my experience is that it causes problems sooner or later.

David Perfors:
First Thomas, he is talking about python :P
Second, I didn't read well :P I never readed anything about an autobuild number.
But a nice thing that such a plugin can do is creating a rc file with file information (like the DevCPP one ;))
It is easier then creating by hand, especialy when you don't know how it works.

thomas:

--- Quote from: mispunt on November 06, 2006, 10:56:21 pm ---First Thomas, he is talking about python :P Second, I didn't read well :P
--- End quote ---
Me neither, as has been shown :P  But it could as well have been perl or ruby, to me they're all widely the same, I have difficulties reading either and don't ever use them because of that.

But seriously, if you think such a plugin is a good thing, then go ahead :)
It's just that I want to warn you of the grief that is ahead. I've already got myself a bloody nose on autorevision, which basically does the same (gets a number from svn and writes it into a file).
Such a thing may be a little less pain when writing a python script because python libraries probably have a native subversion binding, so you have nothing to parse, but in C++, it is a nightmare.

Game_Ender:
Python is more readable than C++ once you have a little practice (have you tried reading template meta programs), but he used plenty of nested conditions, and unusual #end type style for blocks (never seen that before), and no standard python main.  He is also using the subversion libraries directly (which I suggested above) through pysvn, no nasty string parsing needed.  So if you goal is not to use the subversion libraries then this won't help.  That said, pysvn is a very nice binding for subversion, makes it quite easy to automate SVN related tasks.  I use it to keep things like firefox and thunderbird profiles checked in without having to do lots of manual work.

stahta01:
Have you looked at rapidsvn svncpp classes? I have but I am just starting on C++ and it was too hard to follow for me. Note: They have NOT released a 1.4 compatible version yet.

Tim S

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version