(Steve Dougherty)
2013-09-07: Fix the repository list not updating on push. Fix the repository list not updating on push. This means returning the request URIs from execute_push() as intended, which highlights the inconsistency between returning it from execute_create() and execute_push() but nothing else. It is somewhat awkward to have to query WoT for the identity, as the insert URI is present in insert_uri, but wot.py functions largely require a WoT_ID or Local_WoT_ID.
diff --git a/infocalypse/commands.py b/infocalypse/commands.py --- a/infocalypse/commands.py +++ b/infocalypse/commands.py @@ -306,7 +306,9 @@ def infocalypse_push(ui_, repo, **opts): associated_wot_id = stored_cfg.get_wot_identity(request_uri) if inserted_to and associated_wot_id: import wot - wot.update_repo_listing(ui_, associated_wot_id) + from wot_id import Local_WoT_ID + local_id = Local_WoT_ID('@' + associated_wot_id) + wot.update_repo_listing(ui_, local_id) def infocalypse_info(ui_, repo, **opts): diff --git a/infocalypse/infcmds.py b/infocalypse/infcmds.py --- a/infocalypse/infcmds.py +++ b/infocalypse/infcmds.py @@ -498,7 +498,7 @@ def execute_create(ui_, repo, params, st """ Run the create command. - Return the request URI on success, and None on failure. + Return a list of the request URIs on success, and None on failure. """ update_sm = None inserted_to = None @@ -612,10 +612,15 @@ def execute_reinsert(ui_, repo, params, cleanup(update_sm) def execute_push(ui_, repo, params, stored_cfg): - """ Run the push command. """ + """ + Run the push command. + + Return a list of the request URIs on success, and None on failure. + """ assert params.get('REQUEST_URI', None) is None update_sm = None + inserted_to = None try: update_sm = setup(ui_, repo, params, stored_cfg) request_uri, is_keypair = do_key_setup(ui_, update_sm, params, @@ -632,9 +637,9 @@ def execute_push(ui_, repo, params, stor run_until_quiescent(update_sm, params['POLL_SECS']) if update_sm.get_state(QUIESCENT).arrived_from(((FINISHING,))): + inserted_to = update_sm.get_state(INSERTING_URI).get_request_uris() ui_.status("Inserted to:\n%s\n" % - '\n'.join(update_sm.get_state(INSERTING_URI). - get_request_uris())) + '\n'.join(inserted_to)) else: extra = '' if update_sm.ctx.get('UP_TO_DATE', False): @@ -645,6 +650,8 @@ def execute_push(ui_, repo, params, stor finally: cleanup(update_sm) + return inserted_to + def execute_pull(ui_, repo, params, stored_cfg): """ Run the pull command. """ update_sm = None