diff python/setup_repo.py @ 406:38dd72d72086

fix
author Jeff Hammel <jhammel@mozilla.com>
date Wed, 31 Jul 2013 14:25:02 -0700
parents 815eb5c796e9
children daa9356d614f
line wrap: on
line diff
--- a/python/setup_repo.py	Tue Jul 30 18:43:53 2013 -0700
+++ b/python/setup_repo.py	Wed Jul 31 14:25:02 2013 -0700
@@ -23,6 +23,20 @@
     call(['hg', 'add', '-R', directory])
     call(['hg', 'commit', '-m', options.message, '-R', directory])
 
+def write_hgrc(directory, host, repo, name):
+    """write hgrc file"""
+
+    HGRC="""[paths]
+default = http://%(host)s/%(repo)s/%(name)s
+default-push = ssh://%(host)s/%(repo)s/%(remote_path)s
+"""
+
+    path = os.path.join(directory, '.hg', 'hgrc')
+    # TODO: use ConfigParser
+    with file(os.path.join(directory, '.hg', 'hgrc'), 'w') as f:
+        print >> f, HGRC % { 'host': host, 'repo': repo, 'name': name}
+
+
 def setup_remote(local_repo, remote_url, push='ssh', remote_path=None):
     """
     setup a remote repository for local_repo
@@ -44,19 +58,6 @@
     remote_dir = '%s/%s' % (path, name)
     call(['ssh', host, "mkdir -p %s && cd %s && hg init" % (remote_dir, remote_dir)])
 
-def write_hgrc(directory, host, repo, name):
-    """write hgrc file"""
-
-    HGRC="""[paths]
-default = http://%(host)s/%(repo)s/%(name)s
-default-push = ssh://%(host)s/%(repo)s/%(name)s
-"""
-
-    path = os.path.join(directory, '.hg', 'hgrc')
-    # TODO: use ConfigParser
-    with file(os.path.join(directory, '.hg', 'hgrc'), 'w') as f:
-        print >> f, HGRC % { 'host': host, 'repo': repo, 'name': name}
-
 
 def main(args=sys.argv[1:]):