add new task       

Task ID:  4173  Add revision number into summary file    
 
Created by sno036 on 2016-06-20 11:59 AM, 703 days ago
Project:  User Interface
Category:  Bug
Priority:  [no priority]
Assigned to:  [not assigned]  
Status:  closed
Apsim Version:
Your Name:
Contact Details:
 
 

show inline images      show change history

 comment 40478 posted by peter.devoil on 2016-08-19 10:38 AM, 643 days ago 

r3945 allows the same effect by the environment variable "IncludeBuildNumberInOutSumFile"

 comment 40476 posted by peter.devoil on 2016-08-18 4:22 PM, 644 days ago 

Would like to be able to set this as an environment variable - the standard build script will revert the apsim.xml settings file and force it to be "Yes".

 comment 40448 posted by zur003 on 2016-07-07 11:57 AM, 686 days ago 

As of r3922, the default action is to include the revision number, unless the model is being run on a computer named "Bob". Changing the checkbox in the Options menu now works correctly.

 comment 40446 posted by zur003 on 2016-07-06 1:45 PM, 687 days ago 

Actually there's a bug that breaks the current mechanism. There's already a checkbox in the "Options" dialog of the GUI that toggles whether the build number should be included, but this does not work as advertised. The problem appears to be that the ApsimSettings class (in ApsimShared\ApsimSettings.cpp) doesn't access the correct Apsim.xml file - it reads the one in the installation directory rather than the local customised copy. And that's because when building the search path for the file, it neglects to insert "r" before the revision number, and hence looks in the wrong folder. Why haven't we noticed this before?

Anyway, one option may be to change the IncludeBuildNumberInOutSumFile logic so that rather than it being a simple Yes/No, it could be a ternary Yes/No/GUI, with the default "GUI" option indicating that the build number should be ouput only when the simulation in run from the GUI (assuming there's some simple way to determine if that is the case - I don't know whether there is...).

 comment 40436 posted by hol353 on 2016-06-20 12:53 PM, 703 days ago 

The approach that is already in there won't persist across APSIM version updates, so what you're suggesting is probably better. You're correct in saying we don't won't revision numbers in the outs and sums when Bob does a simple diff on each file.

A simple option in the user interface that is on by default would be a good thing to do (not this week though). It could just simply write the required XML fragment to the apsim.xml file. Wouldn't even need a change to the APSIM model infrastructure.

 comment 40435 posted by sno036 on 2016-06-20 12:47 PM, 703 days ago 

I can see how that might work for me (woudl it persist across updates?) but what i am trying to do at the moment is to pick up some work that a departed staff member did.  I can see that it was in 7.7 but also know that it was not the release version.  So what I am suggesting is that the revision number is put in the summary file by default.  I'm guessing that the reason for not doing this that Bob's testing of patches would complain every committ (one way of inhibiting progress keeping stable versions! :-))?  What about an option in the UI (which Bob wouldn't use?) which by default would have it reported?  Maybe all too hard?

(have switched over to Chrome for this reply and pasting works.  Possibly it is an IE11 issue?)

 comment 40434 posted by hol353 on 2016-06-20 12:20 PM, 703 days ago 

You can add the revision number although its a bit cumbersome. You need to add this to the apsim.xml file:

<IncludeBuildNumberInOutSumFile>Yes</IncludeBuildNumberInOutSumFile>

under the <ApsimUI> element.

You then need to get rid of the cached version of APSIM.xml. The easiest way to do that is to click Options in the user interface and then click 'Revert all options' button.

(I'm able to paste into this window OK)

 comment 40433 posted by sno036 on 2016-06-20 11:59 AM, 703 days ago 

At the moment the APSIM version number gets put in the summary file - such as

Version                  = 7.7

Can this be modified to include the revision as well - perhaps

Version                 = 7.7 (r9876)

(also - why cannot I paste anything in this window!?!)