183
183
# avoid circular imports
184
184
from bzrlib import commit
187
185
possible_master_transports=[]
188
if not 'branch-nick' in revprops:
189
revprops['branch-nick'] = self.branch._get_nick(
186
revprops = commit.Commit.update_revprops(
189
kwargs.pop('authors', None),
190
kwargs.pop('author', None),
190
191
kwargs.get('local', False),
191
192
possible_master_transports)
192
authors = kwargs.pop('authors', None)
193
author = kwargs.pop('author', None)
194
if authors is not None:
195
if author is not None:
196
raise AssertionError('Specifying both author and authors '
197
'is not allowed. Specify just authors instead')
198
if 'author' in revprops or 'authors' in revprops:
199
# XXX: maybe we should just accept one of them?
200
raise AssertionError('author property given twice')
202
for individual in authors:
203
if '\n' in individual:
204
raise AssertionError('\\n is not a valid character '
205
'in an author identity')
206
revprops['authors'] = '\n'.join(authors)
207
if author is not None:
208
symbol_versioning.warn('The parameter author was deprecated'
209
' in version 1.13. Use authors instead',
211
if 'author' in revprops or 'authors' in revprops:
212
# XXX: maybe we should just accept one of them?
213
raise AssertionError('author property given twice')
215
raise AssertionError('\\n is not a valid character '
216
'in an author identity')
217
revprops['authors'] = author
218
193
# args for wt.commit start at message from the Commit.commit method,
219
194
args = (message, ) + args
220
195
for hook in MutableTree.hooks['start_commit']:
261
def warn_if_changed_or_out_of_date(self, strict, opt_name, more_msg):
236
def check_changed_or_out_of_date(self, strict, opt_name,
237
more_error, more_warning):
262
238
"""Check the tree for uncommitted changes and branch synchronization.
264
240
If strict is None and not set in the config files, a warning is issued.
270
246
:param opt_name: strict option name to search in config file.
272
:param more_msg: Details about how to avoid the warnings.
248
:param more_error: Details about how to avoid the check.
250
:param more_warning: Details about what is happening.
274
252
if strict is None:
275
253
strict = self.branch.get_config().get_user_option_as_bool(opt_name)
276
254
if strict is not False:
278
256
if (self.has_changes()):
279
err = errors.UncommittedChanges(self, more=more_msg)
257
err_class = errors.UncommittedChanges
280
258
elif self.last_revision() != self.branch.last_revision():
281
259
# The tree has lost sync with its branch, there is little
282
260
# chance that the user is aware of it but he can still force
283
261
# the action with --no-strict
284
err = errors.OutOfDateTree(self, more=more_msg)
262
err_class = errors.OutOfDateTree
263
if err_class is not None:
286
264
if strict is None:
265
err = err_class(self, more=more_warning)
287
266
# We don't want to interrupt the user if he expressed no
288
267
# preference about strict.
289
268
trace.warning('%s', err._format())
270
err = err_class(self, more=more_error)