~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/ui/__init__.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-08-15 13:49:38 UTC
  • mfrom: (6060.3.1 fix-last-revno-args)
  • Revision ID: pqm@pqm.ubuntu.com-20110815134938-4fuo63g4v2hj8jdt
(jelmer) Cope with the localhost having the name 'localhost' when running
 the test suite. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
from bzrlib.lazy_import import lazy_import
48
48
lazy_import(globals(), """
49
49
from bzrlib import (
 
50
    config,
50
51
    osutils,
51
52
    progress,
52
53
    trace,
145
146
            "This may take some time. Upgrade the repositories to the "
146
147
            "same format for better performance."
147
148
            ),
 
149
        experimental_format_fetch=("Fetching into experimental format "
 
150
            "%(to_format)s.\n"
 
151
            "This format may be unreliable or change in the future "
 
152
            "without an upgrade path.\n"),
148
153
        deprecated_command=(
149
154
            "The command 'bzr %(deprecated_name)s' "
150
155
            "has been deprecated in bzr %(deprecated_in_version)s. "
243
248
        """
244
249
        # XXX: is the caller supposed to close the resulting object?
245
250
        if encoding is None:
246
 
            from bzrlib import config
247
 
            encoding = config.GlobalConfig().get_user_option(
248
 
                'output_encoding')
 
251
            encoding = config.GlobalStack().get('output_encoding')
249
252
        if encoding is None:
250
253
            encoding = osutils.get_terminal_encoding(trace=True)
251
254
        if encoding_type is None:
408
411
        """Show a warning to the user."""
409
412
        raise NotImplementedError(self.show_warning)
410
413
 
411
 
    def warn_cross_format_fetch(self, from_format, to_format):
412
 
        """Warn about a potentially slow cross-format transfer.
413
 
        
414
 
        This is deprecated in favor of show_user_warning, but retained for api
415
 
        compatibility in 2.0 and 2.1.
416
 
        """
417
 
        self.show_user_warning('cross_format_fetch', from_format=from_format,
418
 
            to_format=to_format)
419
 
 
420
 
    def warn_experimental_format_fetch(self, inter):
421
 
        """Warn about fetching into experimental repository formats."""
422
 
        if inter.target._format.experimental:
423
 
            trace.warning("Fetching into experimental format %s.\n"
424
 
                "This format may be unreliable or change in the future "
425
 
                "without an upgrade path.\n" % (inter.target._format,))
426
 
 
427
414
 
428
415
class NoninteractiveUIFactory(UIFactory):
429
416
    """Base class for UIs with no user."""