diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2007-12-15 06:11:58 -0800 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2007-12-18 01:12:22 -0800 |
commit | b629c73a014497b3ed0176721b08b91b9ba47ac7 (patch) | |
tree | 44926204b5b87099dc9c6546af4ec6ed3e21c8e6 /gitosis | |
parent | Pylint cleanup. (diff) | |
download | gitosis-dakkar-b629c73a014497b3ed0176721b08b91b9ba47ac7.tar.gz gitosis-dakkar-b629c73a014497b3ed0176721b08b91b9ba47ac7.tar.bz2 gitosis-dakkar-b629c73a014497b3ed0176721b08b91b9ba47ac7.zip |
Factor out the stuff that changes repos based on the config only.
Diffstat (limited to 'gitosis')
-rw-r--r-- | gitosis/run_hook.py | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/gitosis/run_hook.py b/gitosis/run_hook.py index 2e4fa91..a1ce0ad 100644 --- a/gitosis/run_hook.py +++ b/gitosis/run_hook.py @@ -13,6 +13,26 @@ from gitosis import gitdaemon from gitosis import app from gitosis import util +def build_reposistory_data(config): + """ + Using the ``config`` data, perform all actions that affect files in the .git + repositories, such as the description, owner, and export marker. Also + update the projects.list file as needed to list relevant repositories. + + :type config: RawConfigParser + """ + gitweb.set_descriptions( + config=config, + ) + generated = util.getGeneratedFilesDir(config=config) + gitweb.generate_project_list( + config=config, + path=os.path.join(generated, 'projects.list'), + ) + gitdaemon.set_export_ok( + config=config, + ) + def post_update(cfg, git_dir): """ post-update hook for the Gitosis admin directory. @@ -31,17 +51,7 @@ def post_update(cfg, git_dir): os.path.join(export, 'gitosis.conf'), os.path.join(export, '..', 'gitosis.conf'), ) - gitweb.set_descriptions( - config=cfg, - ) - generated = util.getGeneratedFilesDir(config=cfg) - gitweb.generate_project_list( - config=cfg, - path=os.path.join(generated, 'projects.list'), - ) - gitdaemon.set_export_ok( - config=cfg, - ) + build_reposistory_data(cfg) ssh.writeAuthorizedKeys( path=os.path.expanduser('~/.ssh/authorized_keys'), keydir=os.path.join(export, 'keydir'), |