Mercurial > public > mercurial-scm > hg
diff mercurial/error.py @ 43077:687b865b95ad
formatting: byteify all mercurial/ and hgext/ string literals
Done with
python3.7 contrib/byteify-strings.py -i $(hg files 'set:mercurial/**.py - mercurial/thirdparty/** + hgext/**.py - hgext/fsmonitor/pywatchman/** - mercurial/__init__.py')
black -l 80 -t py33 -S $(hg files 'set:**.py - mercurial/thirdparty/** - "contrib/python-zstandard/**" - hgext/fsmonitor/pywatchman/**')
# skip-blame mass-reformatting only
Differential Revision: https://phab.mercurial-scm.org/D6972
author | Augie Fackler <augie@google.com> |
---|---|
date | Sun, 06 Oct 2019 09:48:39 -0400 |
parents | 2372284d9457 |
children | 40bf3d7ecc42 |
line wrap: on
line diff
--- a/mercurial/error.py Sun Oct 06 09:45:02 2019 -0400 +++ b/mercurial/error.py Sun Oct 06 09:48:39 2019 -0400 @@ -73,7 +73,7 @@ from .node import short name = short(name) - RevlogError.__init__(self, '%s@%s: %s' % (index, name, message)) + RevlogError.__init__(self, b'%s@%s: %s' % (index, name, message)) def __bytes__(self): return RevlogError.__bytes__(self) @@ -150,7 +150,7 @@ def __init__(self): from .i18n import _ - Abort.__init__(self, _('response expected')) + Abort.__init__(self, _(b'response expected')) class OutOfBandError(Hint, Exception): @@ -175,7 +175,7 @@ def __init__(self, function, symbols): from .i18n import _ - ParseError.__init__(self, _("unknown identifier: %s") % function) + ParseError.__init__(self, _(b"unknown identifier: %s") % function) self.function = function self.symbols = symbols @@ -214,13 +214,13 @@ from .i18n import _ self.recordtypes = sorted(recordtypes) - s = ' '.join(self.recordtypes) + s = b' '.join(self.recordtypes) Abort.__init__( self, - _('unsupported merge state records: %s') % s, + _(b'unsupported merge state records: %s') % s, hint=_( - 'see https://mercurial-scm.org/wiki/MergeStateRecords for ' - 'more information' + b'see https://mercurial-scm.org/wiki/MergeStateRecords for ' + b'more information' ), ) @@ -244,7 +244,7 @@ class LockHeld(LockError): def __init__(self, errno, filename, desc, locker): - LockError.__init__(self, errno, 'Lock held', filename, desc) + LockError.__init__(self, errno, b'Lock held', filename, desc) self.locker = locker @@ -322,7 +322,7 @@ self.params = params self.values = values if self.parttype is None: - msg = 'Stream Parameter' + msg = b'Stream Parameter' else: msg = parttype entries = self.params @@ -334,9 +334,9 @@ if val is None: entries.append(val) else: - entries.append("%s=%r" % (par, pycompat.maybebytestr(val))) + entries.append(b"%s=%r" % (par, pycompat.maybebytestr(val))) if entries: - msg = '%s - %s' % (msg, ', '.join(entries)) + msg = b'%s - %s' % (msg, b', '.join(entries)) ValueError.__init__(self, msg) @@ -360,7 +360,7 @@ self.ret = ret # no i18n expected to be processed into a better message Abort.__init__( - self, 'failed to update value for "%s/%s"' % (namespace, key) + self, b'failed to update value for "%s/%s"' % (namespace, key) ) @@ -373,7 +373,7 @@ def __init__(self, filename, node, tombstone): from .node import short - StorageError.__init__(self, '%s:%s' % (filename, short(node))) + StorageError.__init__(self, b'%s:%s' % (filename, short(node))) self.tombstone = tombstone