annotate python/install_config.py @ 5:81619b59dd51

adding .hgignore file
author k0s <k0scist@gmail.com>
date Tue, 08 Dec 2009 16:32:23 -0500
parents f58e8e81e16b
children 524f9e7fa224
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
f58e8e81e16b adding program to install config
k0s <k0scist@gmail.com>
parents:
diff changeset
1 #!/usr/bin/env python
f58e8e81e16b adding program to install config
k0s <k0scist@gmail.com>
parents:
diff changeset
2 """
f58e8e81e16b adding program to install config
k0s <k0scist@gmail.com>
parents:
diff changeset
3 installs config to a user's home directory
f58e8e81e16b adding program to install config
k0s <k0scist@gmail.com>
parents:
diff changeset
4 this can be done with
f58e8e81e16b adding program to install config
k0s <k0scist@gmail.com>
parents:
diff changeset
5 curl http://k0s.org/hg/config/python/install-config.py | python
f58e8e81e16b adding program to install config
k0s <k0scist@gmail.com>
parents:
diff changeset
6 """
f58e8e81e16b adding program to install config
k0s <k0scist@gmail.com>
parents:
diff changeset
7
f58e8e81e16b adding program to install config
k0s <k0scist@gmail.com>
parents:
diff changeset
8 SRC='http://k0s.org/hg/config'
f58e8e81e16b adding program to install config
k0s <k0scist@gmail.com>
parents:
diff changeset
9 import os
f58e8e81e16b adding program to install config
k0s <k0scist@gmail.com>
parents:
diff changeset
10 os.chdir(os.environ['HOME'])
f58e8e81e16b adding program to install config
k0s <k0scist@gmail.com>
parents:
diff changeset
11
f58e8e81e16b adding program to install config
k0s <k0scist@gmail.com>
parents:
diff changeset
12 # make the current directory a repository
f58e8e81e16b adding program to install config
k0s <k0scist@gmail.com>
parents:
diff changeset
13 import subprocess
f58e8e81e16b adding program to install config
k0s <k0scist@gmail.com>
parents:
diff changeset
14 subprocess.check_call(['hg', 'init'])
f58e8e81e16b adding program to install config
k0s <k0scist@gmail.com>
parents:
diff changeset
15 subprocess.check_call(['hg', 'pull', SRC])
f58e8e81e16b adding program to install config
k0s <k0scist@gmail.com>
parents:
diff changeset
16 subprocess.check_call(['hg', 'update', '-C'])
f58e8e81e16b adding program to install config
k0s <k0scist@gmail.com>
parents:
diff changeset
17
f58e8e81e16b adding program to install config
k0s <k0scist@gmail.com>
parents:
diff changeset
18