~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/mutabletree.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-04-28 09:40:23 UTC
  • mfrom: (5155.1.5 320119-exclude-ancestry)
  • Revision ID: pqm@pqm.ubuntu.com-20100428094023-7504mlou1qk28r9n
(vila) Add --exclude-common-ancestry log option (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
258
258
            return False
259
259
 
260
260
    @needs_read_lock
261
 
    def check_changed_or_out_of_date(self, strict, opt_name,
262
 
                                     more_error, more_warning):
 
261
    def warn_if_changed_or_out_of_date(self, strict, opt_name, more_msg):
263
262
        """Check the tree for uncommitted changes and branch synchronization.
264
263
 
265
264
        If strict is None and not set in the config files, a warning is issued.
270
269
 
271
270
        :param opt_name: strict option name to search in config file.
272
271
 
273
 
        :param more_error: Details about how to avoid the check.
274
 
 
275
 
        :param more_warning: Details about what is happening.
 
272
        :param more_msg: Details about how to avoid the warnings.
276
273
        """
277
274
        if strict is None:
278
275
            strict = self.branch.get_config().get_user_option_as_bool(opt_name)
279
276
        if strict is not False:
280
 
            err_class = None
 
277
            err = None
281
278
            if (self.has_changes()):
282
 
                err_class = errors.UncommittedChanges
 
279
                err = errors.UncommittedChanges(self, more=more_msg)
283
280
            elif self.last_revision() != self.branch.last_revision():
284
281
                # The tree has lost sync with its branch, there is little
285
282
                # chance that the user is aware of it but he can still force
286
283
                # the action with --no-strict
287
 
                err_class = errors.OutOfDateTree
288
 
            if err_class is not None:
 
284
                err = errors.OutOfDateTree(self, more=more_msg)
 
285
            if err is not None:
289
286
                if strict is None:
290
 
                    err = err_class(self, more=more_warning)
291
287
                    # We don't want to interrupt the user if he expressed no
292
288
                    # preference about strict.
293
289
                    trace.warning('%s', err._format())
294
290
                else:
295
 
                    err = err_class(self, more=more_error)
296
291
                    raise err
297
292
 
298
293
    @needs_read_lock