I ran into an interesting issue. I created a new hg repo, didn't commit anything to it, but promptly forked it. I committed to the forked repo and then tried to open a new pull request but got a 500 error. When I looked at the logs I found it was giving some kind of index out of range error. This error only appears if the repo you are comparing with doesn't have any commits.
Issue #637 resolved