changeset 33:d5e0bce5e411

STUB: silvermirror/hg.py
author Jeff Hammel <k0scist@gmail.com>
date Fri, 31 Jan 2014 21:18:28 -0800
parents fa1fe03ad924
children f0b30886801f
files silvermirror/hg.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/silvermirror/hg.py
+++ b/silvermirror/hg.py
@@ -21,17 +21,17 @@ def update(source, path):
     """
     get changes from host on path
     """
     try:
         repo = hglib.open(path)
         print ('Updating {}:'.format(path))
         repo.pull(host, update=True, insecure=True)
     except ServerError:
-        print ('Cloning {} -> {}'.format(url, path))
+        print ('Cloning {} -> {}'.format(source, path))
         repo = hglib.clone(source, path)
 
 
 # TODO: local repository
 # def repositories(path):
 #     """
 #     return all hg repositories in a path
 #     """
@@ -86,13 +86,14 @@ def main(args=sys.argv[1:]):
         for repo in repos:
             print repo
         sys.exit(0)
 
     # clone/update repos to directory
     if not os.path.exists(options.directory):
         os.mkdir(options.directory)
     for repo in repos:
+        source = '{}/{}'.format(options.host, repo)
         dest = os.path.join(options.directory, repo)
-        update(options.host, dest)
+        update(source, dest)
 
 if __name__ == '__main__':
     main()