svn builds should report the version number

Previous topic - Next topic

tduell

Hello All,
I have been building the latest svn source for a few weeks now, and the "About" of each build always reports "...1.5.0svn 19 Oct 2013".
I think it would be useful/helpful if the build reported the svn update changeset/version number, e.g the latest source today is 18586.
That may help bug tracking.
Just a suggestion.

Cheers,
Terry

Kunda

Might want to mention this on Freenode #scribus

tduell

Quote from: Kunda on November 11, 2013, 11:21:00 PM
Might want to mention this on Freenode #scribus
Not sure what that is.
I guess the developers don't keep an eye on these forums.

Cheers,
Terry

a.l.e

hi tduell,

i don't see a urgent need for that information (basically, my scribus is outdated or up to date... and i mostly know in which state it is :-).

what would your use case be?

anyway, if you provide a simple way to add that information there are chances that it will be implemented... any idea?
(of course, manually changing it is not an option :-)

have a nice day
a.l.e

tduell

I would have thought the need for it was pretty obvious.
If building and/or testing svn development source shows up problems, the developers need to know which changeset or revision number the problem showed up in.
I'm not sure how one would automatically put the revision number into the source from svn, but guess it is similar to how it can be done with hg, within the CmakeLists.txt, by looking for a .svn dir, using whatever svn provides to identify the revision, bung that into a global variable, to be used in the "about" stuff. Just guessing.

If tracking bugs in development source isn't an issue, that's OK.

Cheers,
Terry

tduell

Having another think about how one might incorporate the rev number into the build, it occurs to me that maybe it isn't that important after all.
If building from a repo of the development source, one can readily get the rev number from svn.
The situation where this won't necessarily help is if there are issues with a built version, but the repo has been since updated.
Anyway, it was a suggestion that has proved helpful at times on another project.

Cheers,
Terry

tduell

Perhaps a sensible small step would be to remove the hardwired "19 Oct 2013" from about.cpp and grab the actual build date during the build, to report in the "about" window.

Cheers,

a.l.e

hi terry,

imo, an automatic date/number is mostly interesting, if you have several scribus installed and, yes, the most important value is the revision number (+ the date of the last commit).

the build date is imo not that interesting.

i guess that if you provide a patch for the makefiles that achieve this, the team will probably use it...

ciao
a.l.e

tduell

OK.
I have been thinking about it, and can, sort of, see how it can be done using an hg repo.
I have looked at how it is being done in Hugin (uses hg and WxWidgets), but not sure how to translate those ideas across to Scribus.
It is relatively straightforward to collect the revision number from svn, and that is probably also the case using cmake (ie in CMakeLists.txt). Can't see how one then uses that to write the value into the about dbox in Scribus.
I'll have a bit of a think about it, but suspect that there is too much for me to come to grips with to come up with a suitable patch.
Cheers,
Terry

tduell

Here is my attempt at a CMakeLists.txt which gets the svn rev number and writes it to a file "rev.txt", which might then be read to provide the rev number in about.cpp.
I'm no whiz at regular expressions, so the result in "rev.txt" contains a second record which shouldn't be there. Try as I might I have not been able to get only the rev number.
Posted here in the hope that someone who knows more than I can see how to make the fix and then make use of it.

Cheers,
Terry


[attachment deleted by admin]

tduell

My apologies for the incorrect attachment to the previous post.
Here is my modified CMakeLists.txt.

Cheers,
Terry


[attachment deleted by admin]

tduell

OK, we are making progress.
I now have a top level CMakeLists.txt which captures the svn version number in a variable.
I also have a file "scribus/scribus_version.h.in.cmake" which the top level CMakeLists.txt uses to generate "scribus/ui/scribus_version.h", and have added that header as an include in "scribus/ui/about.cpp" .
This all runs through cmake OK and builds OK.
What I don't know how to do is to use the SCRIBUS_SVN_REVISION variable within "scribus/ui/about.cpp" to display the revision number in the about dbox.
I will have to leave that others to who know about that stuff.
I'm having trouble getting a diff file which reflects these changes, so will attach the relevant files here and hope someone can make some use of them. The .cpp and the .cmake files have had a .txt added to be allowed attachments
Cheers,
Terry

[attachment deleted by admin]

Kunda

This is cool sleuthing. You might get more immediate help if you post to the Scribus mailing list lists.scribus.net

a.l.e

hi terry,

thanks for your work!

i'll have a look at it and i think that the best thing is to add your files -- as a diff -- to the bug tracker.

creating a diff is not that hard...
if you got your files from svn, you can simply do:

svn diff CMakeList.txt

to see the changes against the last version you've updated.

if you want to put the diff in a file you can copy paste it, or redirect the output of "svn diff" to a text file:

svn diff CMakeList.txt > CmakeList.txt.diff

(the ">" being the command that redirects the output!)

if you have an account for the bug tracker you can start the ticket, otherwise i will fill one... and if you don't manage to create diff files, i will do it for you :-)

have fun!
a.l.e

tduell

Quote from: a.l.e on December 13, 2013, 10:37:27 AM
hi terry,

thanks for your work!

i'll have a look at it and i think that the best thing is to add your files -- as a diff -- to the bug tracker.

svn diff CMakeList.txt > CmakeList.txt.diff


if you have an account for the bug tracker you can start the ticket, otherwise i will fill one... and if you don't manage to create diff files, i will do it for you :-)

OK. I don't have an account, so attached my CMakeLists.txt.diff...it has a .txt extension due to limitations of what file types can be attached.
I have had a few tries at getting the revision number into the dbox in about.cpp, but don't know enough to get it to work.

Cheers,
Terry


[attachment deleted by admin]