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

  • Committer: Jelmer Vernooij
  • Date: 2012-01-23 19:08:05 UTC
  • mfrom: (6437.3.20 2.5)
  • mto: This revision was merged to the branch mainline in revision 6450.
  • Revision ID: jelmer@samba.org-20120123190805-hlcuihkt2dep44cw
merge bzr 2.5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
"""
20
20
 
 
21
from __future__ import absolute_import
 
22
 
21
23
import errno
22
24
 
23
25
from bzrlib import (
34
36
    )
35
37
from bzrlib.lockable_files import LockableFiles
36
38
from bzrlib.lockdir import LockDir
 
39
from bzrlib.mutabletree import MutableTree
37
40
from bzrlib.transport.local import LocalTransport
38
41
from bzrlib.workingtree import (
39
42
    InventoryWorkingTree,
40
 
    WorkingTreeFormat,
 
43
    WorkingTreeFormatMetaDir,
41
44
    )
42
45
 
43
46
 
136
139
            self.branch.unlock()
137
140
 
138
141
 
139
 
class WorkingTreeFormat3(WorkingTreeFormat):
 
142
class WorkingTreeFormat3(WorkingTreeFormatMetaDir):
140
143
    """The second working tree format updated to record a format marker.
141
144
 
142
145
    This format:
154
157
 
155
158
    supports_versioned_directories = True
156
159
 
157
 
    def get_format_string(self):
 
160
    @classmethod
 
161
    def get_format_string(cls):
158
162
        """See WorkingTreeFormat.get_format_string()."""
159
163
        return "Bazaar-NG Working Tree format 3"
160
164
 
192
196
        control_files = self._open_control_files(a_bzrdir)
193
197
        control_files.create_lock()
194
198
        control_files.lock_write()
195
 
        transport.put_bytes('format', self.get_format_string(),
 
199
        transport.put_bytes('format', self.as_string(),
196
200
            mode=a_bzrdir._get_file_mode())
197
201
        if from_branch is not None:
198
202
            branch = from_branch
224
228
            else:
225
229
                wt.set_parent_trees([(revision_id, basis_tree)])
226
230
            transform.build_tree(basis_tree, wt)
 
231
            for hook in MutableTree.hooks['post_build_tree']:
 
232
                hook(wt)
227
233
        finally:
228
234
            # Unlock in this order so that the unlock-triggers-flush in
229
235
            # WorkingTree is given a chance to fire.
259
265
                                _format=self,
260
266
                                _bzrdir=a_bzrdir,
261
267
                                _control_files=control_files)
262
 
 
263
 
    def __str__(self):
264
 
        return self.get_format_string()