##// END OF EJS Templates
debug: add a method to check the state of, and built an SSL cert chain...
debug: add a method to check the state of, and built an SSL cert chain This is only useful on Windows, and avoids the need to use Internet Explorer to build the certificate chain. I can see this being extended in the future to print information about the certificate(s) to help debug issues on any platform. Maybe even perform some of the python checks listed on the secure connections wiki page. But for now, all I need is 1) a command that can be invoked in a setup script to ensure the certificate is installed, and 2) a command that the user can run if/when a certificate changes in the future. It would have been nice to leverage the sslutil library to pick up host specific settings, but attempting to use sslutil.wrapsocket() failed the 'not sslsocket.cipher()' check in it and aborted. The output is a little more chatty than some commands, but I've seen the update take 10+ seconds, and this is only a debug command.

File last commit:

r30559:d83ca854 default
r33493:9a9f9521 default
Show More
test-filelog.py
63 lines | 1.6 KiB | text/x-python | PythonLexer
Mads Kiilerich
tests: test test-filelog is python - rename to test-filelog.py
r16498 #!/usr/bin/env python
"""
timeless@mozdev.org
spelling: behaviour -> behavior
r26098 Tests the behavior of filelog w.r.t. data starting with '\1\n'
Mads Kiilerich
tests: test test-filelog is python - rename to test-filelog.py
r16498 """
Robert Stanca
py3: use print_function in test-filelog.py
r28744 from __future__ import absolute_import, print_function
Yuya Nishihara
py3: move up symbol imports to enforce import-checker rules...
r29205
from mercurial.node import (
hex,
nullid,
)
Robert Stanca
py3: use absolute_import in test-filelog.py
r28743 from mercurial import (
hg,
Yuya Nishihara
test-filelog: alias ui as uimod
r28805 ui as uimod,
Robert Stanca
py3: use absolute_import in test-filelog.py
r28743 )
Mads Kiilerich
tests: test test-filelog is python - rename to test-filelog.py
r16498
Yuya Nishihara
ui: factor out ui.load() to create a ui without loading configs (API)...
r30559 myui = uimod.ui.load()
Mads Kiilerich
tests: test test-filelog is python - rename to test-filelog.py
r16498 repo = hg.repository(myui, path='.', create=True)
fl = repo.file('foobar')
def addrev(text, renamed=False):
if renamed:
timeless@mozdev.org
spelling: doesn't/does not
r17486 # data doesn't matter. Just make sure filelog.renamed() returns True
Augie Fackler
test-filelog: move from dict() construction to {} literals...
r20684 meta = {'copyrev': hex(nullid), 'copy': 'bar'}
Mads Kiilerich
tests: test test-filelog is python - rename to test-filelog.py
r16498 else:
meta = {}
lock = t = None
try:
lock = repo.lock()
t = repo.transaction('commit')
node = fl.add(text, meta, t, 0, nullid, nullid)
return node
finally:
if t:
t.close()
if lock:
lock.release()
def error(text):
Robert Stanca
py3: use print_function in test-filelog.py
r28744 print('ERROR: ' + text)
Mads Kiilerich
tests: test test-filelog is python - rename to test-filelog.py
r16498
textwith = '\1\nfoo'
without = 'foo'
node = addrev(textwith)
if not textwith == fl.read(node):
error('filelog.read for data starting with \\1\\n')
if fl.cmp(node, textwith) or not fl.cmp(node, without):
error('filelog.cmp for data starting with \\1\\n')
if fl.size(0) != len(textwith):
error('FIXME: This is a known failure of filelog.size for data starting '
'with \\1\\n')
node = addrev(textwith, renamed=True)
if not textwith == fl.read(node):
error('filelog.read for a renaming + data starting with \\1\\n')
if fl.cmp(node, textwith) or not fl.cmp(node, without):
error('filelog.cmp for a renaming + data starting with \\1\\n')
if fl.size(1) != len(textwith):
error('filelog.size for a renaming + data starting with \\1\\n')
Robert Stanca
py3: use print_function in test-filelog.py
r28744 print('OK.')