Fix expanding resources in list resource APIs.

Review Request #7115 — Created March 25, 2015 and submitted — Latest diff uploaded

Information

Djblets
release-0.8.x
f3a207c...

Reviewers

Some time ago, in order to prevent an infinite loop with expanding some
resources, we started removing any expanded resource keys we found from
the expansion list.

This posed a problem for list resources. The first item listed would
have expansions applied, but subsequent items would not. This made
expansion terribly unreliable when working with lists.

We now save this list before we start altering it, and restore it once
we've finished serializing an object. Any nested objects being
serialized will operate off the altered expansion list, and not the
original in the request.

Unit tests pass.

I was hitting this with a change, and the problem went away. Verified all
resources in a list properly expanded the expected keys.