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
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')
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',
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
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']:
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))
556
579
# install the default hooks into the MutableTree class.