[Updated] D10293: blackbox: fix type error on log rotation on read-only filesystem
valentin.gatienbaron (Valentin Gatien-Baron)
phabricator at mercurial-scm.org
Sun Apr 11 23:23:45 UTC 2021
Closed by commit rHG4a6024b87dfc: blackbox: fix type error on log rotation on read-only filesystem (authored by valentin.gatienbaron).
This revision was automatically updated to reflect the committed changes.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D10293?vs=26639&id=26804
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D10293/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D10293
AFFECTED FILES
mercurial/loggingutil.py
tests/test-blackbox.t
CHANGE DETAILS
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 <<EOF
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:
To: valentin.gatienbaron, #hg-reviewers, Alphare, pulkit
Cc: Alphare, pulkit, mharbison72, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210411/0d67ac2f/attachment-0002.html>
More information about the Mercurial-patches
mailing list