Mercurial > hg > config
view python/install_config.py @ 27:3b88a6c02421
update hgrc settings wrt https://developer.mozilla.org/en/Mercurial_FAQ
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Tue, 09 Mar 2010 12:08:18 -0500 |
parents | 8da594377f18 |
children | 8344c7a9847c |
line wrap: on
line source
#!/usr/bin/env python """ installs config to a user's home directory this can be done with curl http://k0s.org/hg/config/raw-file/tip/python/install_config.py | python """ SRC='http://k0s.org/hg/config' import os import sys HOME=os.environ['HOME'] os.chdir(HOME) # make the current directory a repository import subprocess commands = [ ['hg', 'init'], ['hg', 'pull', SRC], ['hg', 'update', '-C'], # site-specific files ['mkdir', '-p', '.subversion'], ['rm', '-f', '.subversion/config'], ['ln', '-s', os.path.join(HOME, '.subversion_config/config'), os.path.join(HOME, '.subversion/config')], ] for command in commands: code = subprocess.call(command) if code: sys.exit(code)