Mercurial > hg > config
view python/install_config.py @ 11:1e6a394db7ec
add it alias and order aliases
author | k0s <k0scist@gmail.com> |
---|---|
date | Tue, 12 Jan 2010 16:51:44 -0500 |
parents | c38d875a3b78 |
children | ac34d580c6d7 |
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/tip/python/install_config.py | python """ SRC='http://k0s.org/hg/config' import os import sys os.chdir(os.environ['HOME']) # make the current directory a repository import subprocess commands = [ ['hg', 'init'], ['hg', 'pull', SRC], ['hg', 'update', '-C' ] ] for command in commands: code = subprocess.call(command) if code: sys.exit(code)