At present, gets version info by parsing 
leo/core/commit_timestamp.json. There are at least two unacceptable 
problems with this approach:

1. The dates don't get updated if a developer (like me!) forgets to install 
the git hooks.

Just today I noticed that the last update was supposedly in July!

2. Continually changing commit_timestamp.json creates merge conflicts.

There is a much easier way. Rather than parsing commit_timestamp.json, we 
can get info about the last commit from  "git log -1". Like this:

    p = subprocess.Popen(
        ["git", "log" , '-1', '--date=default-local'],
    out, err = p.communicate()
    out = g.toUnicode(out)
    m ='commit (.*)\n', out)
    commit =[0:8].strip() if m else ''
    m ='Date: (.*)\n', out)
    date = if m else '

This works well in my tests.

For official releases, we expect that git won't be installed, or that "git 
log" will fail because the official release contains no .git directory.  
Either way, the code will catch exceptions thrown by subprocess and return 
the official (static) release date defined in

My release testing will ensure that this approach works.  Do you see any 
problems with it?


You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
To post to this group, send email to
Visit this group at
For more options, visit

Reply via email to