/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/version_info_formats/format_python.py

Merge bzr.dev, update to use new hooks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006 Canonical Ltd
 
1
# Copyright (C) 2006, 2009, 2011 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
38
38
 
39
39
 
40
40
_py_version_footer = '''
41
 
 
42
41
if __name__ == '__main__':
43
 
    print 'revision: %(revno)d' % version_info
 
42
    print 'revision: %(revno)s' % version_info
44
43
    print 'nick: %(branch_nick)s' % version_info
45
44
    print 'revision id: %(revision_id)s' % version_info
46
45
'''
61
60
 
62
61
        revision_id = self._get_revision_id()
63
62
        if revision_id == NULL_REVISION:
64
 
            info['revno'] = 0
 
63
            info['revno'] = '0'
65
64
        else:
66
 
            info['revno'] = self._branch.revision_id_to_revno(revision_id)
 
65
            info['revno'] = self._get_revno_str(revision_id)
67
66
            info['revision_id'] = revision_id
68
67
            rev = self._branch.repository.get_revision(revision_id)
69
68
            info['date'] = create_date_str(rev.timestamp, rev.timezone)
84
83
        to_file.write('\n\n')
85
84
 
86
85
        if self._include_history:
87
 
            self._extract_revision_history()
88
 
            revision_str = pprint.pformat(self._revision_history_info)
 
86
            history = list(self._iter_revision_history())
 
87
            revision_str = pprint.pformat(history)
89
88
            to_file.write('revisions = ')
90
89
            to_file.write(revision_str)
91
90
            to_file.write('\n\n')