~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/ui/__init__.py

  • Committer: Jelmer Vernooij
  • Date: 2011-03-12 17:06:27 UTC
  • mto: This revision was merged to the branch mainline in revision 5737.
  • Revision ID: jelmer@samba.org-20110312170627-atq3w464xdarvcro
Use recommend_upgrade.

Show diffs side-by-side

added added

removed removed

Lines of Context:
154
154
            "%(from_format)s to %(to_format)s.\n"
155
155
            "This may take some time. Upgrade the repositories to the "
156
156
            "same format for better performance."
157
 
            )
 
157
            ),
 
158
        recommend_upgrade=("%(current_format_name)s is deprecated "
 
159
            "and a better format is available.\n"
 
160
            "It is recommended that you upgrade by "
 
161
            "running the command\n"
 
162
            "  bzr upgrade %(basedir)s"),
158
163
        )
159
164
 
160
165
    def __init__(self):
343
348
        """
344
349
        return NullProgressView()
345
350
 
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)
 
351
    def recommend_upgrade(self, current_format_name, basedir):
 
352
        """Recommend the user upgrade a control directory.
 
353
 
 
354
        :param current_format_name: Description of the current format
 
355
        :param basedir: Location of the control dir
 
356
        """
 
357
        self.show_user_warning('recommend_upgrade',
 
358
            current_format_name=current_format_name, basedir=basedir)
361
359
 
362
360
    def report_transport_activity(self, transport, byte_count, direction):
363
361
        """Called by transports as they do IO.