sha1_name: cleanup interpret_branch_name()

The 'upstream' variable doesn't hold an "upstream", but a branch, so
make it clearer.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
sha1_name: simplify track finding

It's more efficient to check for the braces first, and we already have
the length of the whole thing.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
sha1_name: add support for @{publish} marks

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

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
remote-hg: always normalize paths

Apparently Mercurial can have paths such as 'foo//bar', so normalize all
paths.

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