Use hg.app with opts.target instead of my crappy attempt.