This is actually the exact opposite of the (much simpler) fix I attempted in https://github.com/jglick/perforce-plugin/commit/64193675fb345eaf6793518c93c69e21f22b4cb9.