diff --git a/mercurial/loggingutil.py b/mercurial/loggingutil.py --- a/mercurial/loggingutil.py +++ b/mercurial/loggingutil.py @@ -10,7 +10,10 @@ import errno -from . import pycompat +from . import ( + encoding, + pycompat, +) from .utils import ( dateutil, @@ -32,7 +35,7 @@ if err.errno != errno.ENOENT: ui.debug( b"warning: cannot remove '%s': %s\n" - % (newpath, err.strerror) + % (newpath, encoding.strtolocal(err.strerror)) ) try: if newpath: @@ -41,7 +44,7 @@ if err.errno != errno.ENOENT: ui.debug( b"warning: cannot rename '%s' to '%s': %s\n" - % (newpath, oldpath, err.strerror) + % (newpath, oldpath, encoding.strtolocal(err.strerror)) ) if maxsize > 0: diff --git a/tests/test-blackbox.t b/tests/test-blackbox.t --- a/tests/test-blackbox.t +++ b/tests/test-blackbox.t @@ -317,6 +317,17 @@ 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> --debug log -r tip exited 0 after *.?? seconds (glob) 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> blackbox +Skip rotation if the .hg is read-only + +#if unix-permissions + $ chmod -w .hg + $ hg log -r. -T '{rev}\n' --config blackbox.maxsize=1 --debug + warning: cannot rename '$TESTTMP/blackboxtest3/.hg/blackbox.log.1' to '$TESTTMP/blackboxtest3/.hg/blackbox.log': Permission denied + warning: cannot write to blackbox.log: Permission denied + 1 + $ chmod +w .hg +#endif + Test log recursion from dirty status check $ cat > ../r.py <