##// END OF EJS Templates
sshpeer: enable+fix warning about sshpeers not being closed explicitly...
sshpeer: enable+fix warning about sshpeers not being closed explicitly I recommend looking at this with a diff that ignores indentation. The test changes are because localrepo.close() updates some cache, which appears happens earlier now on rollbacks or strips or something. The http changes are because httppeer.close() prints stats with --verbose. Differential Revision: https://phab.mercurial-scm.org/D9999

File last commit:

r47410:ebfa20e6 default
r47419:a4c19a16 default
Show More
remotefilelog-getflogheads.py
33 lines | 638 B | text/x-python | PythonLexer
/ tests / remotefilelog-getflogheads.py
from __future__ import absolute_import
from mercurial.i18n import _
from mercurial import (
hg,
registrar,
)
cmdtable = {}
command = registrar.command(cmdtable)
@command(b'getflogheads', [], b'path')
def getflogheads(ui, repo, path):
"""
Extension printing a remotefilelog's heads
Used for testing purpose
"""
dest = repo.ui.expandpath(b'default')
peer = hg.peer(repo, {}, dest)
try:
flogheads = peer.x_rfl_getflogheads(path)
finally:
peer.close()
if flogheads:
for head in flogheads:
ui.write(head + b'\n')
else:
ui.write(_(b'EMPTY\n'))