# HG changeset patch # User Jeff Hammel # Date 1376183222 25200 # Node ID cdad4c445993616b03f4290dabe72a97a94b6299 # Parent 7f1dfb36a0feb6ac090f74c1ca7e85d035280935 python/setup_repo.py diff -r 7f1dfb36a0fe -r cdad4c445993 python/setup_repo.py --- a/python/setup_repo.py Sat Aug 10 18:01:26 2013 -0700 +++ b/python/setup_repo.py Sat Aug 10 18:07:02 2013 -0700 @@ -22,6 +22,10 @@ string = (basestring,) +# global variables that probably shouldn't be +dry_run = True +verbose = True + def call(command, *args, **kwargs): if isinstance(command, string): @@ -46,7 +50,8 @@ """ path = os.path.join(directory, '.hg', 'hgrc') - # TODO: use ConfigParser + # TODO: use ConfigParser and i.e + # http://k0s.org/hg/config/file/95afeaf9c42d/python/hgrc.py with file(os.path.join(directory, '.hg', 'hgrc'), 'w') as f: print >> f, HGRC % { 'host': host, 'repo': repo, 'name': name} @@ -105,6 +110,9 @@ parser.add_option('-o', '--remote-only', dest='remote_only', action='store_true', default=False, help="setup remote server only") + parser.add_option('--dry-run', dest='dry_run', + action='store_true', default=True, + help="") options, args = parser.parse_args(args) # sanitization