# HG changeset patch # User Jeff Hammel # Date 1289233114 28800 # Node ID ac29f67b4a454344751d0f1306fb8e3ef42bf4f1 # Parent d51923b276efe463140f0ee3c7aa4135556cd13a add an option to update the packages diff -r d51923b276ef -r ac29f67b4a45 buttercup/checkout.py --- a/buttercup/checkout.py Mon Nov 08 08:13:21 2010 -0800 +++ b/buttercup/checkout.py Mon Nov 08 08:18:34 2010 -0800 @@ -46,6 +46,8 @@ parser = OptionParser() parser.add_option('--install', action="store_true", default=False, help="install the packages") + parser.add_option('--update', action="store_true", default=False, + help="update the packages") parser.add_option('--list', action="store_true", default=False, help="list the source to be installed") options, args = parser.parse_args(args) @@ -63,10 +65,16 @@ os.mkdir(src) os.chdir(src) - # clone the sources + # clone othe sources for source in sources: if os.path.exists(source[0]): - print "%d already exists" + if options.update: + os.chdir(source[0]) + subprocess.call(['hg', 'pull']) + subprocess.call(['hg', 'update']) + os.chdir('..') + else: + print "%d already exists" else: subprocess.call(['hg', 'clone', source[1]])