Mercurial > hg > config
comparison python/setup_repo.py @ 545:9cf7d5cc9c2b
fix some egregious errors
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Thu, 31 Oct 2013 17:55:05 -0700 |
parents | b8857facac02 |
children |
comparison
equal
deleted
inserted
replaced
544:ed193fcaa0dc | 545:9cf7d5cc9c2b |
---|---|
90 remote_host, remote_path = remote_path.split(':', 1) | 90 remote_host, remote_path = remote_path.split(':', 1) |
91 else: | 91 else: |
92 remote_path = path | 92 remote_path = path |
93 | 93 |
94 # setup remote repository | 94 # setup remote repository |
95 remote_dir = '~/%s' % (path.lstrip('/'), name) | 95 remote_dir = '~/%s/%s' % (path.lstrip('/'), name) |
96 command = ['ssh', host, "mkdir -p %s && cd %s && hg init" % (remote_dir, remote_dir)] | 96 command = ['ssh', host, "mkdir -p %s && cd %s && hg init" % (remote_dir, remote_dir)] |
97 print "setting up remote repo:" | |
98 print command | |
97 call(command) | 99 call(command) |
98 | 100 |
99 | 101 |
100 def main(args=sys.argv[1:]): | 102 def main(args=sys.argv[1:]): |
101 | 103 |
134 | 136 |
135 # setup remote, if specified | 137 # setup remote, if specified |
136 name = os.path.basename(directory) | 138 name = os.path.basename(directory) |
137 if options.remote_url: | 139 if options.remote_url: |
138 | 140 |
141 import pdb; pdb.set_trace() | |
142 | |
139 # setup remote repository | 143 # setup remote repository |
140 setup_remote(directory, options.remote_url, name=name, remote_path=options.remote_path) | 144 setup_remote(directory, options.remote_url, name=name, remote_path=options.remote_path) |
141 | 145 |
142 # push changes | 146 # push changes |
143 command = ['hg', 'push', '-R', directory] | 147 url = '/'.join((options.remote_url.rstrip('/'), |
148 (options.remote_path or name).lstrip('/'))) | |
149 # TODO: setup hgrc | |
150 command = ['hg', 'push', '-R', directory, url] | |
144 call(command) | 151 call(command) |
145 | 152 |
146 if __name__ == '__main__': | 153 if __name__ == '__main__': |
147 main() | 154 main() |