~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/version_info_formats/format_rio.py

  • Committer: Jelmer Vernooij
  • Date: 2009-04-03 21:23:55 UTC
  • mto: This revision was merged to the branch mainline in revision 4252.
  • Revision ID: jelmer@samba.org-20090403212355-z81946ra1auxlkme
Fix version-info in empty branches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""A generator which creates a rio stanza of the current tree info"""
18
18
 
 
19
from bzrlib.revision import (
 
20
    NULL_REVISION,
 
21
    )
19
22
from bzrlib.rio import RioWriter, Stanza
20
23
 
21
24
from bzrlib.version_info_formats import (
30
33
    def generate(self, to_file):
31
34
        info = Stanza()
32
35
        revision_id = self._get_revision_id()
33
 
        if revision_id is not None:
 
36
        if revision_id != NULL_REVISION:
34
37
            info.add('revision-id', revision_id)
35
38
            rev = self._branch.repository.get_revision(revision_id)
36
39
            info.add('date', create_date_str(rev.timestamp, rev.timezone))