remote-hg: write custom revset function

It turns out 'a::b' will miss commits merged between this range if they
have an older number:

  9
  | \
  8 7
  | /
  6

The revset '8:9' will miss '7'.

What we want can only be expressed as '::b - ::a', but that's not
efficient, specially in older versions of Mercurial.
'ancestor(a,b)::b - ancestor(a,b)::a' might be better, but it's not
particularly pretty. Mercurial 3.0 will have a new 'only(b, a)' that
does the same, but we can't rely on newer versions.

And then we need special considerations for when there's no base
revision (importing from root).

Not to mention that revisions older than 2.1 would still have problems.

It's much better to implement our own function to get a range of
revisions.

The new gitrange() is insipred by Mercurial's revset.missingancestors().

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>