remote-hg: shuffle some code

In preparation to shift to SHA-1's.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
remote-hg: improve node traversing

We won't be able to count the unmarked commits, but we are not going to
be able to do that anyway when we switch to SHA-1 ids.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
remote-hg: add version checks to the marks

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
remote-hg: switch from revisions to SHA-1 noteids

Otherwise we won't know if revisions are replaced.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
remote-hg: upgrade version 1 marks

As suggested by Jed Brown; there's no need to re-import all the commits.

Cc: Jed Brown <jed@59a2.org>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
remote-hg: ensure remote rebasing works

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
remote-hg: trivial cleanups

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
remote-hg: improve progress calculation

No need to manually keep track of the revision count.

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