comparison python/setup_repo.py @ 402:c00b70509fff

flesh out
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 30 Jul 2013 03:32:31 -0700
parents f652f9d4765b
children 62eb670a408f
comparison
equal deleted inserted replaced
401:f652f9d4765b 402:c00b70509fff
76 # setup remote repository 76 # setup remote repository
77 call(['ssh', host, "mkdir -p cd %s/%s && hg init && hg add && hg ci -m '%s'" % (repo, name, options.message)]) 77 call(['ssh', host, "mkdir -p cd %s/%s && hg init && hg add && hg ci -m '%s'" % (repo, name, options.message)])
78 78
79 # write local .hgrc file 79 # write local .hgrc file
80 # TODO: use ConfigParser 80 # TODO: use ConfigParser
81 f = file(os.path.join('.hg', 'hgrc'), 'w') 81 with file(os.path.join(directory, '.hg', 'hgrc'), 'w') as f:
82 print >> f, HGRC % { 'host': HOST, 'repo': repo, 'name': name} 82 print >> f, HGRC % { 'host': host, 'repo': repo, 'name': name}
83 83
84 # push changes 84 # push changes
85 call(['hg', 'push', '-R', directory]) 85 call(['hg', 'push', '-R', directory])
86 86
87 if __name__ == '__main__': 87 if __name__ == '__main__':