~ubuntu-branches/ubuntu/trusty/bzr-loom/trusty

« back to all changes in this revision

Viewing changes to formats.py

  • Committer: Package Import Robot
  • Author(s): Jelmer Vernooij
  • Date: 2012-02-26 17:51:52 UTC
  • mfrom: (1.1.12)
  • Revision ID: package-import@ubuntu.com-20120226175152-32qg10g7dp846fuu
* Add script for automatically updating dependencies on merge.
* New upstream release.
 + Fixes compatibility with newer versions of bzr. LP: #924521

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
    }
45
45
 
46
46
def register_formats():
47
 
    if getattr(_mod_branch, 'MetaDirBranchFormatFactory', None):
48
 
        branch_formats = [_mod_branch.MetaDirBranchFormatFactory(format_string,
49
 
            "bzrlib.plugins.loom.branch", format_class) for 
50
 
            (format_string, format_class) in _LOOM_FORMATS.iteritems()]
51
 
    else:
52
 
        # Compat for folk not running bleeding edge. Like me as I commit this.
53
 
        import branch
54
 
        branch_formats = [
55
 
            branch.BzrBranchLoomFormat1(),
56
 
            branch.BzrBranchLoomFormat6(),
57
 
            branch.BzrBranchLoomFormat7(),
58
 
            ]
59
 
    try:
60
 
        format_registry = getattr(_mod_branch, 'format_registry')
61
 
        register = format_registry.register
62
 
    except AttributeError: # bzr < 2.4
63
 
        register = _mod_branch.BranchFormat.register_format
64
 
 
65
 
    map(register, branch_formats)
 
47
    branch_formats = [_mod_branch.MetaDirBranchFormatFactory(format_string,
 
48
        "bzrlib.plugins.loom.branch", format_class) for 
 
49
        (format_string, format_class) in _LOOM_FORMATS.iteritems()]
 
50
    format_registry = getattr(_mod_branch, 'format_registry')
 
51
    map(format_registry.register, branch_formats)
66
52
 
67
53
 
68
54
def require_loom_branch(branch):