Skip to content
Snippets Groups Projects
Commit 60802bba authored by Boris Feld's avatar Boris Feld
Browse files

eol: ensure the eol extensions is loaded when hooks run

Similar to the change we did to the 'acl' extensions, we want to make sure the
config items are registered before we run the hooks.
parent 120c5c15
No related branches found
No related tags found
No related merge requests found
......@@ -244,5 +244,18 @@
"at %s: %s\n") % (inst.args[1], inst.args[0]))
return None
def ensureenabled(ui):
"""make sure the extension is enabled when used as hook
When eol is used through hooks, the extension is never formally loaded and
enabled. This has some side effect, for example the config declaration is
never loaded. This function ensure the extension is enabled when running
hooks.
"""
if 'eol' in ui._knownconfig:
return
ui.setconfig('extensions', 'eol', '', source='internal')
extensions.loadall(ui, ['eol'])
def _checkhook(ui, repo, node, headsonly):
# Get revisions to check and touched files at the same time
......@@ -247,5 +260,6 @@
def _checkhook(ui, repo, node, headsonly):
# Get revisions to check and touched files at the same time
ensureenabled(ui)
files = set()
revs = set()
for rev in xrange(repo[node].rev(), len(repo)):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment