Mercurial > hg > config
comparison python/setup_repo.py @ 449:f39d37973d4b
python/setup_repo.py
| author | Jeff Hammel <jhammel@mozilla.com> |
|---|---|
| date | Sat, 10 Aug 2013 15:52:22 -0700 |
| parents | 056befdec66c |
| children | 56fa913491a1 |
comparison
equal
deleted
inserted
replaced
| 448:056befdec66c | 449:f39d37973d4b |
|---|---|
| 80 parser.add_option('-o', '--remote-only', dest='remote_only', | 80 parser.add_option('-o', '--remote-only', dest='remote_only', |
| 81 action='store_true', default=False, | 81 action='store_true', default=False, |
| 82 help="setup remote server only") | 82 help="setup remote server only") |
| 83 options, args = parser.parse_args(args) | 83 options, args = parser.parse_args(args) |
| 84 | 84 |
| 85 # sanitization | |
| 86 if not args: | |
| 87 args = [os.getcwd()] | |
| 88 if len(args) != 1: | |
| 89 parser.print_usage() | |
| 90 parser.exit() | |
| 91 directory = args[0] | |
| 92 | |
| 85 # initialize repository | 93 # initialize repository |
| 86 if options.remote_only: | 94 if options.remote_only: |
| 87 assert options.remote_url | 95 assert options.remote_url |
| 88 else: | 96 else: |
| 89 if len(args) != 1: | |
| 90 parser.print_usage() | |
| 91 parser.exit() | |
| 92 directory = args[0] | |
| 93 init_repo(directory) | 97 init_repo(directory) |
| 94 | 98 |
| 95 # setup remote, if specified | 99 # setup remote, if specified |
| 96 name = os.path.basename(directory) | 100 name = os.path.basename(directory) |
| 97 if options.remote_url: | 101 if options.remote_url: |
