/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: 2019-06-02 02:35:46 UTC
  • mfrom: (7309 work)
  • mto: This revision was merged to the branch mainline in revision 7319.
  • Revision ID: jelmer@jelmer.uk-20190602023546-lqco868tnv26d8ow
merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
from __future__ import absolute_import
20
20
 
21
 
import breezy
22
21
 
23
22
from ... import (
24
23
    conflicts as _mod_conflicts,
105
104
            branch.unlock()
106
105
        inv = inventory.Inventory()
107
106
        wt = WorkingTree2(a_controldir.root_transport.local_abspath('.'),
108
 
                         branch,
109
 
                         inv,
110
 
                         _internal=True,
111
 
                         _format=self,
112
 
                         _controldir=a_controldir,
113
 
                         _control_files=branch.control_files)
 
107
                          branch,
 
108
                          inv,
 
109
                          _internal=True,
 
110
                          _format=self,
 
111
                          _controldir=a_controldir,
 
112
                          _control_files=branch.control_files)
114
113
        basis_tree = branch.repository.revision_tree(revision_id)
115
114
        if basis_tree.get_root_id() is not None:
116
115
            wt.set_root_id(basis_tree.get_root_id())
142
141
        if not isinstance(a_controldir.transport, LocalTransport):
143
142
            raise errors.NotLocalUrl(a_controldir.transport.base)
144
143
        wt = WorkingTree2(a_controldir.root_transport.local_abspath('.'),
145
 
                           _internal=True,
146
 
                           _format=self,
147
 
                           _controldir=a_controldir,
148
 
                           _control_files=a_controldir.open_branch().control_files)
 
144
                          _internal=True,
 
145
                          _format=self,
 
146
                          _controldir=a_controldir,
 
147
                          _control_files=a_controldir.open_branch().control_files)
149
148
        return wt
150
149
 
151
150
 
172
171
        """Return the references needed to perform a check of this tree."""
173
172
        return [('trees', self.last_revision())]
174
173
 
175
 
 
176
174
    def lock_tree_write(self):
177
175
        """See WorkingTree.lock_tree_write().
178
176
 
208
206
 
209
207
    def _iter_conflicts(self):
210
208
        conflicted = set()
211
 
        for info in self.list_files():
212
 
            path = info[0]
 
209
        for path, file_class, file_kind, entry in self.list_files():
213
210
            stem = get_conflicted_stem(path)
214
211
            if stem is None:
215
212
                continue
230
227
                if text is True:
231
228
                    for suffix in ('.THIS', '.OTHER'):
232
229
                        try:
233
 
                            kind = osutils.file_kind(self.abspath(conflicted+suffix))
 
230
                            kind = osutils.file_kind(
 
231
                                self.abspath(conflicted + suffix))
234
232
                            if kind != "file":
235
233
                                text = False
236
234
                        except errors.NoSuchFile:
237
235
                            text = False
238
 
                        if text == False:
 
236
                        if text is False:
239
237
                            break
240
 
                ctype = {True: 'text conflict', False: 'contents conflict'}[text]
 
238
                ctype = {True: 'text conflict',
 
239
                         False: 'contents conflict'}[text]
241
240
                conflicts.append(_mod_conflicts.Conflict.factory(ctype,
242
 
                                 path=conflicted,
243
 
                                 file_id=self.path2id(conflicted)))
 
241
                                                                 path=conflicted,
 
242
                                                                 file_id=self.path2id(conflicted)))
244
243
            return conflicts
245
244
 
246
245
    def set_conflicts(self, arg):