remote-hg: disable forced push by default

In certain situations we might end up pushing garbage revisions (e.g. in
a rebase), and the patches to deal with that haven't been merged yet.

So let's disable forced pushes by default.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
remote-hg: don't push fake 'master' bookmark

We skip it locally, but not for the remote, so let's do so.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
remote-hg: update bookmarks when pulling

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
remote-hg: test: be a little more quiet

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
remote-hg: fix new branch creation

When force_push is disabled, we need to turn the argument to True.

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

We only need to get the remote dict once.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
remote-helpers: test: cleanup white-spaces

We prefer tabs to spaces.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
remote-helpers: test: cleanup style

So it's more standardized between all the tests.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
remote-helpers: tests: general improvements

So that we don't need a temporary directory.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
remote-helpers: test: simplify remote URLs

No need to specify $PWD any more.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
remote-hg: test: simplify previous branch checkout

@{-1} does the same thing.

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

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
remote-hg: get rid of unused exception checks

We are not calling check_output() anymore.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
remote-hg: enable track-branches in hg-git mode

The user can turn this off.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
remote-hg: add new get_config_bool() helper

No functional changes.

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

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
remote-hg: fix simple tags

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
remote-hg: always point HEAD to master

Mercurial always checks out the 'default' branch, so there's no point in
complicating our lives trying to do something fancier, which causes
different behavior depending on whether the repository is local or
remote.

So let's always use 'default' (which we translate to 'master'), unless
we are in hg-git mode, which expects us to use the 'master' bookmark
instead.

Also, update the tests that used to check for different checkout
behaviors to simply check that the refs are there, remove unnecessary
ones, and fix the ones that expect something different.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
remote-bzr: simplify test checks

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
remote-hg: add check_bookmark() test helper

And check in a more proper way.

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