~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/info.py

PEP8ify

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
        return 's'
46
46
 
47
47
 
48
 
def _get_format_string(object):
49
 
    """Return format string of object, where object is of type
50
 
    bzrlib.workingtree, bzrlib.branch or bzrlib.repository.
 
48
def _get_format_string(target):
 
49
    """Return format string of target.
 
50
    
 
51
    Target must be of type bzrlib.workingtree, bzrlib.branch or
 
52
    bzrlib.repository.
 
53
 
51
54
    """
52
55
    try:
53
 
        return object._format.get_format_string().rstrip()
 
56
        return target._format.get_format_string().rstrip()
54
57
    except NotImplementedError:
55
 
        return object.bzrdir._format    # FIXME Use rstrip to be safe?
 
58
        return target.bzrdir._format    # XXX: Use rstrip to be safe?
56
59
 
57
60
 
58
61
@deprecated_function(zero_eight)
80
83
    working_format = _get_format_string(working)
81
84
    branch_format = _get_format_string(branch)
82
85
    repository_format = _get_format_string(repository)
83
 
    # TODO metadir_format = ...
 
86
    # TODO: metadir_format = ...
84
87
 
85
88
    if debug:
86
89
        print '   working.bzrdir = %s' % working.bzrdir.root_transport.base
98
101
    print 'location:'
99
102
    if working.bzrdir != branch.bzrdir:
100
103
        # Lightweight checkout
101
 
        print '        checkout root: %s' \
102
 
                % working.bzrdir.root_transport.base
103
 
        print '   checkout of branch: %s' \
104
 
                % branch.bzrdir.root_transport.base
 
104
        print '        checkout root: %s' % (
 
105
            working.bzrdir.root_transport.base)
 
106
        print '   checkout of branch: %s' % (
 
107
            branch.bzrdir.root_transport.base)
105
108
    else:
106
109
        # Standalone or bound branch (normal checkout)
107
 
        print '          branch root: %s' \
108
 
                % branch.bzrdir.root_transport.base
 
110
        print '          branch root: %s' % (
 
111
            branch.bzrdir.root_transport.base)
109
112
        if branch.get_bound_location():
110
113
            print '      bound to branch: %s' % branch.get_bound_location()
111
114
 
112
115
    if repository.bzrdir != branch.bzrdir:
113
116
        if repository.is_shared():
114
 
            print '    shared repository: %s' \
115
 
                    % repository.bzrdir.root_transport.base
 
117
            print '    shared repository: %s' % (
 
118
                repository.bzrdir.root_transport.base)
116
119
        else:
117
 
            print '           repository: %s' \
118
 
                    % repository.bzrdir.root_transport.base
 
120
            print '           repository: %s' % (
 
121
                repository.bzrdir.root_transport.base)
119
122
 
120
123
    if branch.get_parent():
121
124
        print '        parent branch: %s' % branch.get_parent()
127
130
    if working_format == branch_format == repository_format:
128
131
        print '        branch format: %s' % branch_format
129
132
    else:
130
 
        # TODO print 'meta directory format: %s' % metadir_format
 
133
        # TODO: print 'meta directory format: %s' % metadir_format
131
134
        print '  working tree format: %s' % working_format
132
135
        print '        branch format: %s' % branch_format
133
136
        print '    repository format: %s' % repository_format
169
172
            ignore_cnt += 1
170
173
        else:
171
174
            unknown_cnt += 1
172
 
 
173
175
    print '  %8d unknown' % unknown_cnt
174
176
    print '  %8d ignored' % ignore_cnt
175
177