/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 __init__.py

Add stanza with git commit info in 'bzr version-info'

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
from bzrlib.trace import (
47
47
    warning,
48
48
    )
 
49
from bzrlib.version_info_formats.format_rio import (
 
50
    RioVersionInfoBuilder,
 
51
    )
 
52
 
49
53
 
50
54
# versions ending in 'exp' mean experimental mappings
51
55
# versions ending in 'dev' mean development version
246
250
plugin_cmds.register_lazy("cmd_git_serve", [], "bzrlib.plugins.git.commands")
247
251
plugin_cmds.register_lazy("cmd_git_import", [], "bzrlib.plugins.git.commands")
248
252
 
 
253
def update_stanza(rev, stanza):
 
254
    mapping = getattr(rev, "mapping", None)
 
255
    if mapping is not None and mapping.revid_prefix.startswith("git-"):
 
256
        stanza.add("git-commit", rev.foreign_revid)
 
257
 
 
258
 
 
259
RioVersionInfoBuilder.hooks.install_named_hook('revision',
 
260
    update_stanza, None)
 
261
 
249
262
def get_rich_root_format(stacked=False):
250
263
    if stacked:
251
264
        return bzrdir.format_registry.make_bzrdir("1.9-rich-root")