Mercurial > hg > config
comparison python/setup_repo.py @ 527:76b1723c87fc
python/setup_repo.py
| author | Jeff Hammel <jhammel@mozilla.com> |
|---|---|
| date | Tue, 24 Sep 2013 13:12:26 -0700 |
| parents | 4063bbeaa7d4 |
| children | b8857facac02 |
comparison
equal
deleted
inserted
replaced
| 526:4063bbeaa7d4 | 527:76b1723c87fc |
|---|---|
| 34 command_str = subprocess.list2cmdline(command) | 34 command_str = subprocess.list2cmdline(command) |
| 35 | 35 |
| 36 print 'Running:\n%s' % (command_str) | 36 print 'Running:\n%s' % (command_str) |
| 37 if globals()['dry_run']: | 37 if globals()['dry_run']: |
| 38 return | 38 return |
| 39 return subprocess.check_output(*args, **kwargs) | 39 return subprocess.check_output(command, *args, **kwargs) |
| 40 | 40 |
| 41 def init_repo(directory, message): | 41 def init_repo(directory, message): |
| 42 """setup repository""" | 42 """setup repository""" |
| 43 call(['hg', 'init', directory]) | 43 call(['hg', 'init', directory]) |
| 44 call(['hg', 'add', '-R', directory]) | 44 call(['hg', 'add', '-R', directory]) |
| 111 help="remote path of hg repository links; otherwise taken from --remote-url, if specified") | 111 help="remote path of hg repository links; otherwise taken from --remote-url, if specified") |
| 112 parser.add_option('-o', '--remote-only', dest='remote_only', | 112 parser.add_option('-o', '--remote-only', dest='remote_only', |
| 113 action='store_true', default=False, | 113 action='store_true', default=False, |
| 114 help="setup remote server only") | 114 help="setup remote server only") |
| 115 parser.add_option('--dry-run', dest='dry_run', | 115 parser.add_option('--dry-run', dest='dry_run', |
| 116 action='store_true', default=True, | 116 action='store_true', default=False, |
| 117 help="") | 117 help="") |
| 118 options, args = parser.parse_args(args) | 118 options, args = parser.parse_args(args) |
| 119 | 119 |
| 120 # sanitization | 120 # sanitization |
| 121 if not args: | 121 if not args: |
