mergestate: rename a helpless variable name to bit helpful one
The old variable name `r` makes it ~impossible to understand what does it mean.
One can only understand that after going to callers and hoping that its
documented there.
I also documented return value of the function involved while I was there.
Differential Revision: https://phab.mercurial-scm.org/D8738