~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

  • Committer: Robert Collins
  • Date: 2006-03-07 12:39:38 UTC
  • mfrom: (1594 +trunk)
  • mto: (1594.2.4 integration)
  • mto: This revision was merged to the branch mainline in revision 1596.
  • Revision ID: robertc@robertcollins.net-20060307123938-f75ff66ebcc0c4d0
Merge in bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
                           NoSuchFile,
63
63
                           NotVersionedError)
64
64
from bzrlib.inventory import InventoryEntry, Inventory
65
 
from bzrlib.lockable_files import LockableFiles
 
65
from bzrlib.lockable_files import LockableFiles, TransportLock
66
66
from bzrlib.merge import merge_inner, transform_tree
67
67
from bzrlib.osutils import (
68
68
                            abspath,
255
255
            assert isinstance(self._format, WorkingTreeFormat3)
256
256
            self._control_files = LockableFiles(
257
257
                self.bzrdir.get_workingtree_transport(None),
258
 
                'lock')
 
258
                'lock', TransportLock)
259
259
 
260
260
        # update the whole cache up front and write to disk if anything changed;
261
261
        # in the future we might want to do this more selectively
454
454
            tree.set_last_revision(revision_id)
455
455
 
456
456
    @needs_write_lock
457
 
    def commit(self, *args, **kwargs):
 
457
    def commit(self, message=None, revprops=None, *args, **kwargs):
 
458
        # avoid circular imports
458
459
        from bzrlib.commit import Commit
 
460
        if revprops is None:
 
461
            revprops = {}
 
462
        if not 'branch-nick' in revprops:
 
463
            revprops['branch-nick'] = self.branch.nick
459
464
        # args for wt.commit start at message from the Commit.commit method,
460
465
        # but with branch a kwarg now, passing in args as is results in the
461
466
        #message being used for the branch
462
 
        args = (DEPRECATED_PARAMETER, ) + args
463
 
        Commit().commit(working_tree=self, *args, **kwargs)
 
467
        args = (DEPRECATED_PARAMETER, message, ) + args
 
468
        Commit().commit(working_tree=self, revprops=revprops, *args, **kwargs)
464
469
        self._set_inventory(self.read_working_inventory())
465
470
 
466
471
    def id2abspath(self, file_id):
1429
1434
        if not isinstance(a_bzrdir.transport, LocalTransport):
1430
1435
            raise errors.NotLocalUrl(a_bzrdir.transport.base)
1431
1436
        transport = a_bzrdir.get_workingtree_transport(self)
1432
 
        control_files = LockableFiles(transport, 'lock')
 
1437
        control_files = LockableFiles(transport, 'lock', TransportLock)
1433
1438
        control_files.put_utf8('format', self.get_format_string())
1434
1439
        branch = a_bzrdir.open_branch()
1435
1440
        if revision_id is None: