Mercurial > hg > config
comparison python/setup_repo.py @ 454:f7c49c61f092
python/setup_repo.py
| author | Jeff Hammel <jhammel@mozilla.com> |
|---|---|
| date | Sat, 10 Aug 2013 17:53:33 -0700 |
| parents | 7d6bd51f0323 |
| children | 81a237bcf3b6 |
comparison
equal
deleted
inserted
replaced
| 453:be91c9fb3147 | 454:f7c49c61f092 |
|---|---|
| 9 """ | 9 """ |
| 10 | 10 |
| 11 # TODO: | 11 # TODO: |
| 12 # There are patterns here... | 12 # There are patterns here... |
| 13 # - actions | 13 # - actions |
| 14 # - ... | 14 # - --dry-run/call() |
| 15 | 15 |
| 16 import os | 16 import os |
| 17 import subprocess | 17 import subprocess |
| 18 import sys | 18 import sys |
| 19 import urlparse | 19 import urlparse |
| 20 | 20 |
| 21 from optparse import OptionParser | 21 from optparse import OptionParser |
| 22 | 22 |
| 23 call = subprocess.check_output | 23 def call(command, *args, **kwargs): |
| 24 return subprocess.check_output(*args, **kwargs) | |
| 24 | 25 |
| 25 def init_repo(directory): | 26 def init_repo(directory): |
| 26 """setup repository""" | 27 """setup repository""" |
| 27 call(['hg', 'init', directory]) | 28 call(['hg', 'init', directory]) |
| 28 call(['hg', 'add', '-R', directory]) | 29 call(['hg', 'add', '-R', directory]) |
| 117 | 118 |
| 118 # setup remote repository | 119 # setup remote repository |
| 119 setup_remote(directory, options.remote_url, name=name, remote_path=options.remote_path) | 120 setup_remote(directory, options.remote_url, name=name, remote_path=options.remote_path) |
| 120 | 121 |
| 121 # push changes | 122 # push changes |
| 122 call(['hg', 'push', '-R', directory]) | 123 command = ['hg', 'push', '-R', directory] |
| 124 print command | |
| 125 # call(command) | |
| 123 | 126 |
| 124 if __name__ == '__main__': | 127 if __name__ == '__main__': |
| 125 main() | 128 main() |
