Clean up code duplication for revision parsing and fix previous commit to not import into remotes/p4 (yet!).
Clean up code duplication for revision parsing and fix previous commit to not
import into remotes/p4 (yet!).

Signed-off-by: Simon Hausmann <088e16a1019277b15d58faf0541e11910eb756f6@lst.de>

destenson/git,destenson/git,destenson/git,destenson/git,destenson/git,destenson/git,destenson/git,destenson/git