django/django — pull request #764 by vdboor (2013-02-23 14:12:49+00:00)
Title: Ticket 15849, make ifchanged node thread safe.

Previously, the ifchanged node stored state on `self._last_seen`, theirby giving undesired results when the node is reused by another thread at the same time (e.g. globally caching a Template object).

This patch addresses that, by using `context['forloop']` in for loops and `context.render_context` as fallback. Concurrency is emulated in the tests thanks to generators.

Ticket: https://code.djangoproject.com/ticket/15849