/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 breezy/plugins/weave_fmt/workingtree.py

  • Committer: Jelmer Vernooij
  • Date: 2017-09-06 04:15:55 UTC
  • mfrom: (6754.8.21 lock-context-2)
  • Revision ID: jelmer@jelmer.uk-20170906041555-jtr5qxli38167gc6
Merge lp:~jelmer/brz/lock-context-2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
    inventory,
31
31
    xml5,
32
32
    )
33
 
from ...decorators import needs_read_lock
34
33
from ...mutabletree import MutableTree
35
34
from ...sixish import (
36
35
    BytesIO,
214
213
                conflicted.add(stem)
215
214
                yield stem
216
215
 
217
 
    @needs_read_lock
218
216
    def conflicts(self):
219
 
        conflicts = _mod_conflicts.ConflictList()
220
 
        for conflicted in self._iter_conflicts():
221
 
            text = True
222
 
            try:
223
 
                if osutils.file_kind(self.abspath(conflicted)) != "file":
 
217
        with self.lock_read():
 
218
            conflicts = _mod_conflicts.ConflictList()
 
219
            for conflicted in self._iter_conflicts():
 
220
                text = True
 
221
                try:
 
222
                    if osutils.file_kind(self.abspath(conflicted)) != "file":
 
223
                        text = False
 
224
                except errors.NoSuchFile:
224
225
                    text = False
225
 
            except errors.NoSuchFile:
226
 
                text = False
227
 
            if text is True:
228
 
                for suffix in ('.THIS', '.OTHER'):
229
 
                    try:
230
 
                        kind = osutils.file_kind(self.abspath(conflicted+suffix))
231
 
                        if kind != "file":
 
226
                if text is True:
 
227
                    for suffix in ('.THIS', '.OTHER'):
 
228
                        try:
 
229
                            kind = osutils.file_kind(self.abspath(conflicted+suffix))
 
230
                            if kind != "file":
 
231
                                text = False
 
232
                        except errors.NoSuchFile:
232
233
                            text = False
233
 
                    except errors.NoSuchFile:
234
 
                        text = False
235
 
                    if text == False:
236
 
                        break
237
 
            ctype = {True: 'text conflict', False: 'contents conflict'}[text]
238
 
            conflicts.append(_mod_conflicts.Conflict.factory(ctype,
239
 
                             path=conflicted,
240
 
                             file_id=self.path2id(conflicted)))
241
 
        return conflicts
 
234
                        if text == False:
 
235
                            break
 
236
                ctype = {True: 'text conflict', False: 'contents conflict'}[text]
 
237
                conflicts.append(_mod_conflicts.Conflict.factory(ctype,
 
238
                                 path=conflicted,
 
239
                                 file_id=self.path2id(conflicted)))
 
240
            return conflicts
242
241
 
243
242
    def set_conflicts(self, arg):
244
243
        raise errors.UnsupportedOperation(self.set_conflicts, self)