~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/shelf_ui.py

  • Committer: Jonathan Riddell
  • Date: 2011-09-16 11:13:47 UTC
  • mto: This revision was merged to the branch mainline in revision 6144.
  • Revision ID: jriddell@canonical.com-20110916111347-fyjk426bkl0jrbfu
gettext() show_warning usage

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
    ui,
35
35
    workingtree,
36
36
)
37
 
 
 
37
from bzrlib.i18n import gettext
38
38
 
39
39
class UseEditor(Exception):
40
40
    """Use an editor instead of selecting hunks."""
66
66
 
67
67
    def shelved_id(self, shelf_id):
68
68
        """Report the id changes were shelved to."""
69
 
        trace.note('Changes shelved with id "%d".' % shelf_id)
 
69
        trace.note(gettext('Changes shelved with id "%d".') % shelf_id)
70
70
 
71
71
    def changes_destroyed(self):
72
72
        """Report that changes were made without shelving."""
73
 
        trace.note('Selected changes destroyed.')
 
73
        trace.note(gettext('Selected changes destroyed.'))
74
74
 
75
75
    def selected_changes(self, transform):
76
76
        """Report the changes that were selected."""
77
 
        trace.note("Selected changes:")
 
77
        trace.note(gettext("Selected changes:"))
78
78
        changes = transform.iter_changes()
79
79
        delta.report_changes(changes, self.delta_reporter)
80
80
 
262
262
            # to prompt the user, better abort now.  See
263
263
            # https://code.launchpad.net/~bialix/bzr/shelve-no-tty/+merge/14905
264
264
            # for more context.
265
 
            raise errors.BzrError("You need a controlling terminal.")
 
265
            raise errors.BzrError(gettext("You need a controlling terminal."))
266
266
        sys.stdout.write(message)
267
267
        char = osutils.getchar()
268
268
        sys.stdout.write("\r" + ' ' * len(message) + '\r')
412
412
            else:
413
413
                shelf_id = manager.last_shelf()
414
414
                if shelf_id is None:
415
 
                    raise errors.BzrCommandError('No changes are shelved.')
 
415
                    raise errors.BzrCommandError(gettext('No changes are shelved.'))
416
416
            apply_changes = True
417
417
            delete_shelf = True
418
418
            read_shelf = True
470
470
        cleanups = [self.tree.unlock]
471
471
        try:
472
472
            if self.read_shelf:
473
 
                trace.note('Using changes with id "%d".' % self.shelf_id)
 
473
                trace.note(gettext('Using changes with id "%d".') % self.shelf_id)
474
474
                unshelver = self.manager.get_unshelver(self.shelf_id)
475
475
                cleanups.append(unshelver.finalize)
476
476
                if unshelver.message is not None:
477
 
                    trace.note('Message: %s' % unshelver.message)
 
477
                    trace.note(gettext('Message: %s') % unshelver.message)
478
478
                change_reporter = delta._ChangeReporter()
479
479
                merger = unshelver.make_merger(None)
480
480
                merger.change_reporter = change_reporter
486
486
                    self.show_changes(merger)
487
487
            if self.delete_shelf:
488
488
                self.manager.delete_shelf(self.shelf_id)
489
 
                trace.note('Deleted changes with id "%d".' % self.shelf_id)
 
489
                trace.note(gettext('Deleted changes with id "%d".') % self.shelf_id)
490
490
        finally:
491
491
            for cleanup in reversed(cleanups):
492
492
                cleanup()