~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/mutabletree.py

  • Committer: Vincent Ladeuil
  • Date: 2010-04-22 14:18:17 UTC
  • mto: (5190.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5191.
  • Revision ID: v.ladeuil+lp@free.fr-20100422141817-izoao20264ivkauo
Explain that the uncommitted changes are not processed when
issuing the warning.

* bzrlib/mutabletree.py:
(MutableTree.check_changed_or_out_of_date): Use diferent 'more'
arguments depending on whether we issue a warning or an error.

* bzrlib/send.py:
(send): Add the more_warnings argument when calling
check_changed_or_out_of_date.

* bzrlib/foreign.py:
(cmd_dpush.run): Add the more_warnings argument when calling
check_changed_or_out_of_date.

* bzrlib/builtins.py:
(cmd_push.run): Add the more_warnings argument when calling
check_changed_or_out_of_date.

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 warn_if_changed_or_out_of_date(self, strict, opt_name, more_msg):
 
261
    def check_changed_or_out_of_date(self, strict, opt_name,
 
262
                                     more_error, more_warning):
262
263
        """Check the tree for uncommitted changes and branch synchronization.
263
264
 
264
265
        If strict is None and not set in the config files, a warning is issued.
269
270
 
270
271
        :param opt_name: strict option name to search in config file.
271
272
 
272
 
        :param more_msg: Details about how to avoid the check.
 
273
        :param more_error: Details about how to avoid the check.
 
274
 
 
275
        :param more_warning: Details about what is happening.
273
276
        """
274
277
        if strict is None:
275
278
            strict = self.branch.get_config().get_user_option_as_bool(opt_name)
284
287
                err_class = errors.OutOfDateTree
285
288
            if err_class is not None:
286
289
                if strict is None:
287
 
                    err = err_class(self)
 
290
                    err = err_class(self, more=more_warning)
288
291
                    # We don't want to interrupt the user if he expressed no
289
292
                    # preference about strict.
290
293
                    trace.warning('%s', err._format())
291
294
                else:
292
 
                    err = err_class(self, more=more_msg)
 
295
                    err = err_class(self, more=more_error)
293
296
                    raise err
294
297
 
295
298
    @needs_read_lock