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

Merge disable-medusa-for-python-2.6 into pyftpdlib

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
    add,
29
29
    bzrdir,
30
30
    hooks,
 
31
    symbol_versioning,
31
32
    )
32
33
from bzrlib.osutils import dirname
33
34
from bzrlib.revisiontree import RevisionTree
41
42
    )
42
43
from bzrlib.decorators import needs_read_lock, needs_write_lock
43
44
from bzrlib.osutils import splitpath
44
 
from bzrlib.symbol_versioning import DEPRECATED_PARAMETER
45
45
 
46
46
 
47
47
def needs_tree_write_lock(unbound):
192
192
            revprops['branch-nick'] = self.branch._get_nick(
193
193
                kwargs.get('local', False),
194
194
                possible_master_transports)
 
195
        authors = kwargs.pop('authors', None)
195
196
        author = kwargs.pop('author', None)
 
197
        if authors is not None:
 
198
            if author is not None:
 
199
                raise AssertionError('Specifying both author and authors '
 
200
                        'is not allowed. Specify just authors instead')
 
201
            if 'author' in revprops or 'authors' in revprops:
 
202
                # XXX: maybe we should just accept one of them?
 
203
                raise AssertionError('author property given twice')
 
204
            if authors:
 
205
                for individual in authors:
 
206
                    if '\n' in individual:
 
207
                        raise AssertionError('\\n is not a valid character '
 
208
                                'in an author identity')
 
209
                revprops['authors'] = '\n'.join(authors)
196
210
        if author is not None:
197
 
            if 'author' in revprops:
 
211
            symbol_versioning.warn('The parameter author was deprecated'
 
212
                   ' in version 1.13. Use authors instead',
 
213
                   DeprecationWarning)
 
214
            if 'author' in revprops or 'authors' in revprops:
198
215
                # XXX: maybe we should just accept one of them?
199
216
                raise AssertionError('author property given twice')
200
 
            revprops['author'] = author
 
217
            if '\n' in author:
 
218
                raise AssertionError('\\n is not a valid character '
 
219
                        'in an author identity')
 
220
            revprops['authors'] = author
201
221
        # args for wt.commit start at message from the Commit.commit method,
202
222
        args = (message, ) + args
203
223
        for hook in MutableTree.hooks['start_commit']:
549
569
 
550
570
        """
551
571
        hooks.Hooks.__init__(self)
552
 
        # Invoked before a commit is done in a tree. New in 1.4
553
 
        self['start_commit'] = []
 
572
        self.create_hook(hooks.HookPoint('start_commit',
 
573
            "Called before a commit is performed on a tree. The start commit "
 
574
            "hook is able to change the tree before the commit takes place. "
 
575
            "start_commit is called with the bzrlib.tree.MutableTree that the "
 
576
            "commit is being performed on.", (1, 4), None))
554
577
 
555
578
 
556
579
# install the default hooks into the MutableTree class.