# HG changeset patch # User Paul Crowley # Date 1236344626 0 # Node ID 5af89523a9d3f14b1d059f8f5cbb14a74d623396 # Parent 9d2ae2841bf2aa4a56bcfbad557706429d25b7b3 give refreshauth.py a hook and call that in hgadmin hgrc diff -r 9d2ae2841bf2 -r 5af89523a9d3 doc/PLAN --- a/doc/PLAN Fri Mar 06 12:51:07 2009 +0000 +++ b/doc/PLAN Fri Mar 06 13:03:46 2009 +0000 @@ -7,10 +7,10 @@ - reduce hg-ssh-wrapper to nothing by moving all functionality into hg-ssh - same for refresh-auth - move most of do-refresh-auth into a module +- give that module a hook, and call the hook instead of the exe Todo: -- give that module a hook, and call the hook instead of the exe - abolish refresh-auth shell script and rename do-refresh-auth to refresh-auth - replace env vars with Python globals - change refresh-auth to refer to hg-ssh directly, abolish hg-ssh-wrapper diff -r 9d2ae2841bf2 -r 5af89523a9d3 src/init/conf/remote-hgrc --- a/src/init/conf/remote-hgrc Fri Mar 06 12:51:07 2009 +0000 +++ b/src/init/conf/remote-hgrc Fri Mar 06 13:03:46 2009 +0000 @@ -1,9 +1,5 @@ # hgrc to use for all remote users -#[extensions] -#access = /usr/local/lib/mercurial-server/mercurialserver/access.py -#servelog = /usr/local/lib/mercurial-server/servelog.py - [hooks] pretxnchangegroup.access = python:mercurialserver.access.hook changegroup.aaaaa_servelog = python:mercurialserver.servelog.hook diff -r 9d2ae2841bf2 -r 5af89523a9d3 src/init/hgadmin-hgrc --- a/src/init/hgadmin-hgrc Fri Mar 06 12:51:07 2009 +0000 +++ b/src/init/hgadmin-hgrc Fri Mar 06 13:03:46 2009 +0000 @@ -4,4 +4,4 @@ [hooks] changegroup.aaaab_update = hg update -C default > /dev/null changegroup.aaaac_purge = hg purge --all > /dev/null -changegroup.refreshauth = /etc/mercurial-server/refresh-auth +changegroup.refreshauth = python:mercurialserver.refreshauth.hook diff -r 9d2ae2841bf2 -r 5af89523a9d3 src/mercurialserver/refreshauth.py --- a/src/mercurialserver/refreshauth.py Fri Mar 06 12:51:07 2009 +0000 +++ b/src/mercurialserver/refreshauth.py Fri Mar 06 13:03:46 2009 +0000 @@ -66,3 +66,7 @@ akeys.close() os.rename(akeyfile + "_new", akeyfile) + +def hook(ui, repo, hooktype, node=None, source=None, **kwargs): + refreshAuth() +