# HG changeset patch # User Matt Harbison # Date 1692627718 14400 # Node ID 0a4efb650b3efedbce997ee6e05d8487579d41f6 # Parent 181936ad069a0d958a6605b996158b60a0dc0a5e transaction: fix __repr__() and make the default name bytes This likely was always wrong on py3, since going back to aff5996f3043, these were added as a r-strings. Callers seem to always be supplying bytes, which makes the `b'/'.join(...)` part OK, but then bytes can't be interpolated into str with "%s", so it wouldn't have worked in either case. diff -r 181936ad069a -r 0a4efb650b3e mercurial/transaction.py --- a/mercurial/transaction.py Sun Aug 20 16:32:18 2023 -0400 +++ b/mercurial/transaction.py Mon Aug 21 10:21:58 2023 -0400 @@ -16,6 +16,7 @@ from .i18n import _ from . import ( + encoding, error, pycompat, util, @@ -229,7 +230,7 @@ validator=None, releasefn=None, checkambigfiles=None, - name='', + name=b'', ): """Begin a new transaction @@ -318,7 +319,7 @@ def __repr__(self): name = b'/'.join(self._names) return '' % ( - name, + encoding.strfromlocal(name), self._count, self._usages, ) @@ -574,7 +575,7 @@ self._file.flush() @active - def nest(self, name=''): + def nest(self, name=b''): self._count += 1 self._usages += 1 self._names.append(name)