~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-06-14 08:08:36 UTC
  • mfrom: (5425.4.30 220464-stale-locks)
  • Revision ID: pqm@pqm.ubuntu.com-20110614080836-d06kod1br6j1rx6j
(mbp) optionally detect and steal dead locks from the same machine and user
 (bug 220464) (Martin Pool)

Show diffs side-by-side

added added

removed removed

Lines of Context:
154
154
            "It is recommended that you upgrade by "
155
155
            "running the command\n"
156
156
            "  bzr upgrade %(basedir)s"),
 
157
        locks_steal_dead=(
 
158
            u"Stole dead lock %(lock_url)s %(other_holder_info)s."),
157
159
        )
158
160
 
159
161
    def __init__(self):
304
306
        try:
305
307
            template = self._user_warning_templates[warning_id]
306
308
        except KeyError:
307
 
            fail = "failed to format warning %r, %r" % (warning_id, message_args)
308
 
            warnings.warn(fail)   # so tests will fail etc
 
309
            fail = "bzr warning: %r, %r" % (warning_id, message_args)
 
310
            warnings.warn("no template for warning: " + fail)   # so tests will fail etc
309
311
            return fail
310
312
        try:
311
313
            return template % message_args
312
314
        except ValueError, e:
313
 
            fail = "failed to format warning %r, %r: %s" % (
 
315
            fail = "bzr unprintable warning: %r, %r, %s" % (
314
316
                warning_id, message_args, e)
315
317
            warnings.warn(fail)   # so tests will fail etc
316
318
            return fail