/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: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-05-06 03:06:18 UTC
  • mfrom: (7500.1.2 trunk-merge-3.1)
  • Revision ID: breezy.the.bot@gmail.com-20200506030618-131sjbc876q7on66
Merge the 3.1 branch.

Merged from https://code.launchpad.net/~jelmer/brz/trunk-merge-3.1/+merge/383481

Show diffs side-by-side

added added

removed removed

Lines of Context:
98
98
but helps protect against colliding host names.
99
99
"""
100
100
 
101
 
from __future__ import absolute_import
102
 
 
103
101
 
104
102
# TODO: We sometimes have the problem that our attempt to rename '1234' to
105
103
# 'held' fails because the transport server moves into an existing directory,
139
137
    )
140
138
from .i18n import gettext
141
139
from .osutils import format_delta, rand_chars, get_host_name
142
 
from .sixish import (
143
 
    PY3,
144
 
    text_type,
145
 
    )
146
140
from .trace import mutter, note
147
141
 
148
142
 
302
296
                    ui.ui_factory.show_user_warning(
303
297
                        'locks_steal_dead',
304
298
                        lock_url=urlutils.join(self.transport.base, self.path),
305
 
                        other_holder_info=text_type(other_holder))
 
299
                        other_holder_info=str(other_holder))
306
300
                    self.force_break(other_holder)
307
301
                    self._trace("stole lock from dead holder")
308
302
                    return
406
400
            if ui.ui_factory.confirm_action(
407
401
                u"Break %(lock_info)s",
408
402
                'breezy.lockdir.break',
409
 
                    dict(lock_info=text_type(holder_info))):
 
403
                    dict(lock_info=str(holder_info))):
410
404
                result = self.force_break(holder_info)
411
405
                ui.ui_factory.show_message(
412
406
                    "Broke lock %s" % result.lock_url)
730
724
        """Return a debugging representation of this object."""
731
725
        return "%s(%r)" % (self.__class__.__name__, self.info_dict)
732
726
 
733
 
    def __unicode__(self):
 
727
    def __str__(self):
734
728
        """Return a user-oriented description of this object."""
735
729
        d = self.to_readable_dict()
736
730
        return (gettext(
737
731
            u'held by %(user)s on %(hostname)s (process #%(pid)s), '
738
732
            u'acquired %(time_ago)s') % d)
739
733
 
740
 
    if PY3:
741
 
        __str__ = __unicode__
742
 
 
743
734
    def to_readable_dict(self):
744
735
        """Turn the holder info into a dict of human-readable attributes.
745
736