/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/lockdir.py

  • Committer: Jelmer Vernooij
  • Date: 2020-02-07 02:14:30 UTC
  • mto: This revision was merged to the branch mainline in revision 7492.
  • Revision ID: jelmer@jelmer.uk-20200207021430-m49iq3x4x8xlib6x
Drop python2 support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
139
139
    )
140
140
from .i18n import gettext
141
141
from .osutils import format_delta, rand_chars, get_host_name
142
 
from .sixish import (
143
 
    PY3,
144
 
    text_type,
145
 
    )
146
142
from .trace import mutter, note
147
143
 
148
144
 
302
298
                    ui.ui_factory.show_user_warning(
303
299
                        'locks_steal_dead',
304
300
                        lock_url=urlutils.join(self.transport.base, self.path),
305
 
                        other_holder_info=text_type(other_holder))
 
301
                        other_holder_info=str(other_holder))
306
302
                    self.force_break(other_holder)
307
303
                    self._trace("stole lock from dead holder")
308
304
                    return
406
402
            if ui.ui_factory.confirm_action(
407
403
                u"Break %(lock_info)s",
408
404
                'breezy.lockdir.break',
409
 
                    dict(lock_info=text_type(holder_info))):
 
405
                    dict(lock_info=str(holder_info))):
410
406
                result = self.force_break(holder_info)
411
407
                ui.ui_factory.show_message(
412
408
                    "Broke lock %s" % result.lock_url)
730
726
        """Return a debugging representation of this object."""
731
727
        return "%s(%r)" % (self.__class__.__name__, self.info_dict)
732
728
 
733
 
    def __unicode__(self):
 
729
    def __str__(self):
734
730
        """Return a user-oriented description of this object."""
735
731
        d = self.to_readable_dict()
736
732
        return (gettext(
737
733
            u'held by %(user)s on %(hostname)s (process #%(pid)s), '
738
734
            u'acquired %(time_ago)s') % d)
739
735
 
740
 
    if PY3:
741
 
        __str__ = __unicode__
742
 
 
743
736
    def to_readable_dict(self):
744
737
        """Turn the holder info into a dict of human-readable attributes.
745
738