# HG changeset patch # User Jeff Hammel # Date 1422838141 0 # Node ID 52937c25edf0ef3eea1518cf7f54e1e29ceb7f67 # Parent e86d475435eed4d670c2d760465d7d001435dffc stub diff -r e86d475435ee -r 52937c25edf0 silvermirror/hg.py --- a/silvermirror/hg.py Sun May 04 23:14:15 2014 -0700 +++ b/silvermirror/hg.py Mon Feb 02 00:49:01 2015 +0000 @@ -4,10 +4,11 @@ stub for the hg backend of silvermirror """ +# imports +import argparse import hglib # http://mercurial.selenic.com/wiki/PythonHglib import os import sys -import argparse from hglib.error import ServerError _import_error = None @@ -69,13 +70,16 @@ parser.add_argument('-d', '--directory', dest='directory', default=os.path.join(os.environ['HOME'], 'hg'), help="base directory to clone/update to [DEFAULT: %(default)s]") + parser.add_argument('-r', '--repo', dest='repositories', nargs='+', + help="repositories") # TODO: stub parser.add_argument('--list', dest='list', action='store_true', default=False, help="list repositories and exit") options = parser.parse_args(args) + if _import_error is not None: - # XXX better error handling - parser.error("Must have hglib and lxml package to use, sorry: {}".format(_import_error)) + # TODO: better error handling + parser.error("Must have hglib and lxml package to use, sorry:\n{}".format(_import_error)) # kill trailing slash options.host = options.host.rstrip('/')