##// END OF EJS Templates
blackbox: fix type error on log rotation on read-only filesystem...
Valentin Gatien-Baron -
r47654:4a6024b8 default
parent child Browse files
Show More
@@ -10,7 +10,10 b' from __future__ import absolute_import'
10
10
11 import errno
11 import errno
12
12
13 from . import pycompat
13 from . import (
14 encoding,
15 pycompat,
16 )
14
17
15 from .utils import (
18 from .utils import (
16 dateutil,
19 dateutil,
@@ -32,7 +35,7 b' def openlogfile(ui, vfs, name, maxfiles='
32 if err.errno != errno.ENOENT:
35 if err.errno != errno.ENOENT:
33 ui.debug(
36 ui.debug(
34 b"warning: cannot remove '%s': %s\n"
37 b"warning: cannot remove '%s': %s\n"
35 % (newpath, err.strerror)
38 % (newpath, encoding.strtolocal(err.strerror))
36 )
39 )
37 try:
40 try:
38 if newpath:
41 if newpath:
@@ -41,7 +44,7 b' def openlogfile(ui, vfs, name, maxfiles='
41 if err.errno != errno.ENOENT:
44 if err.errno != errno.ENOENT:
42 ui.debug(
45 ui.debug(
43 b"warning: cannot rename '%s' to '%s': %s\n"
46 b"warning: cannot rename '%s' to '%s': %s\n"
44 % (newpath, oldpath, err.strerror)
47 % (newpath, oldpath, encoding.strtolocal(err.strerror))
45 )
48 )
46
49
47 if maxsize > 0:
50 if maxsize > 0:
@@ -317,6 +317,17 b' log rotation'
317 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> --debug log -r tip exited 0 after *.?? seconds (glob)
317 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> --debug log -r tip exited 0 after *.?? seconds (glob)
318 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> blackbox
318 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> blackbox
319
319
320 Skip rotation if the .hg is read-only
321
322 #if unix-permissions
323 $ chmod -w .hg
324 $ hg log -r. -T '{rev}\n' --config blackbox.maxsize=1 --debug
325 warning: cannot rename '$TESTTMP/blackboxtest3/.hg/blackbox.log.1' to '$TESTTMP/blackboxtest3/.hg/blackbox.log': Permission denied
326 warning: cannot write to blackbox.log: Permission denied
327 1
328 $ chmod +w .hg
329 #endif
330
320 Test log recursion from dirty status check
331 Test log recursion from dirty status check
321
332
322 $ cat > ../r.py <<EOF
333 $ cat > ../r.py <<EOF
General Comments 0
You need to be logged in to leave comments. Login now