restore the library numbering system

Bug #527043 reported by Adrien Saladin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PTools
Fix Released
High
Adrien Saladin

Bug Description

PTools on subversion used a tool called "svnrev" allowing to uniquely track the version of the library used for simulations.
Since we moved to bazaar this version number is not recorded any more. However I see no reason why the same thing could not be done with bazaar.

One possible problem is the branch numbering. Two related branches can have two commits with the same revision number, but one can use branch name to remove ambiguity, and maybe sha1 (or md5 or whatever hashing method used by bazaar to track commits) to be absolutely sure of which ptools version is used.

Related branches

Changed in ptools:
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Adrien Saladin (adrien-saladin) wrote :
Revision history for this message
Adrien Saladin (adrien-saladin) wrote :

there is a command: bzr version-info. Used with the --python option, it may be a solution to this problem.
Here is an example of the output:

#!/usr/bin/env python
"""This file is automatically generated by generate_version_info
It uses the current working tree to determine the revision.
So don't edit it. :)
"""

version_info = {'branch_nick': u'ptools',
 'build_date': '2010-02-28 17:49:25 +0100',
 'clean': None,
 'date': '2010-02-27 22:54:38 +0100',
 'revision_id': '<email address hidden>',
 'revno': 426}

revisions = {}

file_revisions = {}

if __name__ == '__main__':
    print 'revision: %(revno)d' % version_info
    print 'nick: %(branch_nick)s' % version_info
    print 'revision id: %(revision_id)s' % version_info

####

Is there a way to know if the working tree differs from the last commit ? Could this be the 'clean' attribute ?

Revision history for this message
Pierre Poulain (pierrepo) wrote :

Interesting solution, but I do not know if the file _version.py created by
bzr version-info --python
is updated automatically (without the need to re-run the brz version-info command after each commit).

The clean attribute can indeed be useful to determine whether or not the working tree is up-to-date.
http://doc.bazaar.canonical.com/latest/en/user-guide/version_info.html

Revision history for this message
Adrien Saladin (adrien-saladin) wrote :

It's not updated automatically by bzr. This step must be managed by the build system (ie SCons), as it was done for svnrev.

Revision history for this message
Adrien Saladin (adrien-saladin) wrote :

If we implement the "bzr version-info" solution, the numbering will differs form what svnrev does.
svnrev works this way: it takes all $Id$ tags from monitored .h/.cpp/.f files and keeps the highest number.
The bzr version-info solution will work as if all files in the repository have an $Id$ tag. This means that if we modify for example the tutorial, the library will return a version number incremented by 1.

The question is: is this a desired behavior ?

Maybe this bug deserves a bluprint...

Revision history for this message
Adrien Saladin (adrien-saladin) wrote :

I just started a new branch for this feature. It's not complete yet, some Python scripts probably need to be fixed.

Changed in ptools:
assignee: nobody → Adrien Saladin (adrien-saladin)
Changed in ptools:
status: Confirmed → In Progress
Changed in ptools:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.