fiorix/txredisapi — pull request #41 by dgvncsz0f (2013-02-06 14:54:15+00:00)
Title: BUGFIX: WATCH + MGET clearing inTransaction prematurely. WATCH + HGETALL does not use post_proc

The previous commit didn't fix all bugs. Hopefully this will make things right.

To reproduce the 1st problem:

> t = yield conn.watch(k)
> t.mget([k])
> assert t.inTransaction # boOoOm!

To reproduce the second problem:

> t = yield conn.watch(k)
> h = yield t.hgetall(k)
> assert type(h) == dict # boOoOm!

This commit introduces a `commit_cc' function (similar to
`unwatch_cc') which clears the `inTransaction' flag only if there has
been a `MULTI' command before (fixes the 1st problem).

The second problem is fixed by not delaying using `post_proc'
function if only `watch' has been issued.