~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/ui/__init__.py

  • Committer: Andrew Bennetts
  • Date: 2010-10-08 04:25:10 UTC
  • mto: This revision was merged to the branch mainline in revision 5472.
  • Revision ID: andrew.bennetts@canonical.com-20101008042510-sg9vdhmnggilzxsk
Fix stray TAB in source.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2011 Canonical Ltd
 
1
# Copyright (C) 2005-2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
42
42
"""
43
43
 
44
44
 
 
45
import os
 
46
import sys
45
47
import warnings
46
48
 
47
49
from bzrlib.lazy_import import lazy_import
48
50
lazy_import(globals(), """
 
51
import getpass
 
52
 
49
53
from bzrlib import (
 
54
    errors,
50
55
    osutils,
51
56
    progress,
52
57
    trace,
53
58
    )
54
59
""")
 
60
from bzrlib.symbol_versioning import (
 
61
    deprecated_function,
 
62
    deprecated_in,
 
63
    deprecated_method,
 
64
    )
55
65
 
56
66
 
57
67
_valid_boolean_strings = dict(yes=True, no=False,
144
154
            "%(from_format)s to %(to_format)s.\n"
145
155
            "This may take some time. Upgrade the repositories to the "
146
156
            "same format for better performance."
147
 
            ),
148
 
        deprecated_command=(
149
 
            "The command 'bzr %(deprecated_name)s' "
150
 
            "has been deprecated in bzr %(deprecated_in_version)s. "
151
 
            "Please use 'bzr %(recommended_name)s' instead."),
152
 
        recommend_upgrade=("%(current_format_name)s is deprecated "
153
 
            "and a better format is available.\n"
154
 
            "It is recommended that you upgrade by "
155
 
            "running the command\n"
156
 
            "  bzr upgrade %(basedir)s"),
 
157
            )
157
158
        )
158
159
 
159
160
    def __init__(self):
342
343
        """
343
344
        return NullProgressView()
344
345
 
345
 
    def recommend_upgrade(self, current_format_name, basedir):
346
 
        """Recommend the user upgrade a control directory.
347
 
 
348
 
        :param current_format_name: Description of the current format
349
 
        :param basedir: Location of the control dir
350
 
        """
351
 
        self.show_user_warning('recommend_upgrade',
352
 
            current_format_name=current_format_name, basedir=basedir)
 
346
    def recommend_upgrade(self,
 
347
        current_format_name,
 
348
        basedir):
 
349
        # XXX: this should perhaps be in the TextUIFactory and the default can do
 
350
        # nothing
 
351
        #
 
352
        # XXX: Change to show_user_warning - that will accomplish the previous
 
353
        # xxx. -- mbp 2010-02-25
 
354
        trace.warning("%s is deprecated "
 
355
            "and a better format is available.\n"
 
356
            "It is recommended that you upgrade by "
 
357
            "running the command\n"
 
358
            "  bzr upgrade %s",
 
359
            current_format_name,
 
360
            basedir)
353
361
 
354
362
    def report_transport_activity(self, transport, byte_count, direction):
355
363
        """Called by transports as they do IO.