From: karim hamidou Date: Mon, 30 Jul 2012 11:47:09 +0000 (+0200) Subject: fixed a bug where a file would be uploaded only to be retrieved immediately after X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=37f114268e2fbd5ec68b70f363f116a135270f0a;p=cagibi.git fixed a bug where a file would be uploaded only to be retrieved immediately after --- diff --git a/cagibi/cagibi.py b/cagibi/cagibi.py index 19bbb7e..b6eaa07 100644 --- a/cagibi/cagibi.py +++ b/cagibi/cagibi.py @@ -106,7 +106,13 @@ def upload_local_changes(): request = urllib2.Request(url, data=put_string) request.add_header('Content-Type', 'application/json') request.get_method = lambda: 'PUT' - url = opener.open(request) + try: + url = opener.open(request) + local_files = load_config("files.json") + local_files[file] = {"rev": 1} + save_config(local_files, filename="files.json") + except HTTPError: + continue while not mqueue.removed.empty(): file = mqueue.removed.get() @@ -115,7 +121,10 @@ def upload_local_changes(): url = "%s/files/%s" % (server_url, file) request = urllib2.Request(url) request.get_method = lambda: 'DELETE' - url = opener.open(request) + try: + url = opener.open(request) + except HTTPError: + continue def checkout_upstream_changes(): """Checkout changes on the server"""