Bug 2062 - In case of nested RCS choose the one closest to the file when commiting.

Patch from bug 2062, no unit test because I couldn’t wrap my head around the only existing test.