Mercurial > hg > config
comparison python/setup_repo.py @ 456:7f1dfb36a0fe
python/setup_repo.py
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Sat, 10 Aug 2013 18:01:26 -0700 |
parents | 81a237bcf3b6 |
children | cdad4c445993 |
comparison
equal
deleted
inserted
replaced
455:81a237bcf3b6 | 456:7f1dfb36a0fe |
---|---|
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 string = (basestring,) | |
24 | |
23 def call(command, *args, **kwargs): | 25 def call(command, *args, **kwargs): |
26 | |
27 if isinstance(command, string): | |
28 command_str = command | |
29 else: | |
30 command_str = ' '.join(command) | |
31 print 'Running:\n%s' % (command_str) | |
24 return subprocess.check_output(*args, **kwargs) | 32 return subprocess.check_output(*args, **kwargs) |
25 | 33 |
26 def init_repo(directory): | 34 def init_repo(directory): |
27 """setup repository""" | 35 """setup repository""" |
28 call(['hg', 'init', directory]) | 36 call(['hg', 'init', directory]) |