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

In status, read lock the old and new trees being used to let data caching occur.

Show diffs side-by-side

added added

removed removed

Lines of Context:
134
134
                    raise errors.BzrCommandError(str(e))
135
135
            else:
136
136
                new = wt
137
 
        _raise_if_nonexistent(specific_files, old, new)
138
 
        delta = new.changes_from(old, want_unchanged=show_unchanged,
139
 
                              specific_files=specific_files)
140
 
        delta.show(to_file,
141
 
                   show_ids=show_ids,
142
 
                   show_unchanged=show_unchanged,
143
 
                   short_status=short)
144
 
        short_status_letter = '?'
145
 
        if not short:
146
 
            short_status_letter = ''
147
 
        list_paths('unknown', new.unknowns(), specific_files, to_file,
148
 
                   short_status_letter)
149
 
        conflict_title = False
150
 
        # show the new conflicts only for now. XXX: get them from the delta.
151
 
        for conflict in new.conflicts():
152
 
            if not short and conflict_title is False:
153
 
                print >> to_file, "conflicts:"
154
 
                conflict_title = True
155
 
            if short:
156
 
                prefix = 'C '
157
 
            else:
158
 
                prefix = ' '
159
 
            print >> to_file, "%s %s" % (prefix, conflict)
160
 
        if new_is_working_tree and show_pending:
161
 
            show_pending_merges(new, to_file, short)
 
137
        old.lock_read()
 
138
        new.lock_read()
 
139
        try:
 
140
            _raise_if_nonexistent(specific_files, old, new)
 
141
            delta = new.changes_from(old, want_unchanged=show_unchanged,
 
142
                                  specific_files=specific_files)
 
143
            delta.show(to_file,
 
144
                       show_ids=show_ids,
 
145
                       show_unchanged=show_unchanged,
 
146
                       short_status=short)
 
147
            short_status_letter = '?'
 
148
            if not short:
 
149
                short_status_letter = ''
 
150
            list_paths('unknown', new.unknowns(), specific_files, to_file,
 
151
                       short_status_letter)
 
152
            conflict_title = False
 
153
            # show the new conflicts only for now. XXX: get them from the delta.
 
154
            for conflict in new.conflicts():
 
155
                if not short and conflict_title is False:
 
156
                    print >> to_file, "conflicts:"
 
157
                    conflict_title = True
 
158
                if short:
 
159
                    prefix = 'C '
 
160
                else:
 
161
                    prefix = ' '
 
162
                print >> to_file, "%s %s" % (prefix, conflict)
 
163
            if new_is_working_tree and show_pending:
 
164
                show_pending_merges(new, to_file, short)
 
165
        finally:
 
166
            old.unlock()
 
167
            new.unlock()
162
168
    finally:
163
169
        wt.unlock()
164
170