git-remote-mediawiki: extract revision-importing loop to a function