← Back to team overview

launchpad-dev team mailing list archive

Re: API issue moving branches

 

On 07/05/10 14:12, Tim Penhey wrote:
Hi Leonard,

There is a method exposed on IBranch called setTarget.  Currently this is
marked with @export_write_operation().

However setting the target changes the URL for the object, and after the move
has happened, we get the following error:

Traceback (most recent call last):
   File "<console>", line 1, in<module>
   File "./lp-prompt", line 47, in move_branch_to_project
     branch.setTarget(project=target)
   File "/usr/lib/pymodules/python2.6/lazr/restfulclient/resource.py", line
490, in __call__
     self.resource.lp_refresh()
   File "/usr/lib/pymodules/python2.6/lazr/restfulclient/resource.py", line
618, in lp_refresh
     super(Entry, self).lp_refresh(new_url, etag)
   File "/usr/lib/pymodules/python2.6/lazr/restfulclient/resource.py", line
293, in lp_refresh
     raise e
HTTPError: HTTP Error 404: Not Found

Not surprising, but how can we tell the restfulclient that the url for the
entry has changed?

I'm pretty sure that lazr.restful returns a redirect if a write operation changes the canonical url -- but could the unique name cache be messing us up here?

Cheers,
mwh



References