Follow-up to r6126: finally understood what that `del req.chrome` was good for...
Follow-up to r6126: finally understood what that `del req.chrome` was good for...

This was needed when an error occurs during the rendering of a template.

Here's a summary of what happens:
 1. render_template() is called normally, the data is prepared and the chrome data is filled with the initial values obtained from the req callback for chrome, augmented by  all calls to add_link, add_scripts etc.
 2. right before the template stream is rendered, the req.chrome fields are reset to empty lists, which are also reachable by the `late_links` and `late_scripts` values
 3. oops, an internal error while rendering
 4. the `req.chrome['links']` are restored so that they can be used while rendering the error template
 5. the error handling code does another round of render_template(), this time for the error.html template
 6. now the interesting stuff happens if it's an internal error:
    - the chrome data gets updated again with the req.chrome, which are at this point still the (empty) "late" lists, and because of that, the jquery.js script is not loaded and the nice interactive stack trace display ''doesn't work'' anymore
    - before, when we had the `del req.chrome`, when the chrome data got updated by the req.chrome, this triggered ''another'' call to the req callback for "chrome", i.e. another Chrome.prepare_request, which would add among other things the jquery.js back...

So I think an "obvious" fix of this problem while still preserving the #5594 behavior is to restore the 'scripts' as well at point 4.

Of course, the management of the chrome data could probably be greatly simplified at some point after 0.11.

git-svn-id: 0d96b0c1a6983ccc08b3732614f4d6bfcf9cbb42@6135 af82e41b-90c4-0310-8c96-b1721e28e2e2

rbaumg/trac,rbaumg/trac,rbaumg/trac,rbaumg/trac