rhg: look for repository in ancestors also instead of cwd only

Last patch introduced config reading at startup to parse value of `--repository`
flag. However, that patch only tried to check for current repository at current
working directory and not it's ancestors. This patch fixes that.

Differential Revision: https://phab.mercurial-scm.org/D10767
15 jobs for topic/default/rust-rocket in 40 minutes and 7 seconds (queued for 5 seconds)
Status Job ID Name Coverage
  Tests
manual #205282
allowed to fail manual
check-pytype-py3
passed #205269
checks-py2

00:06:33

passed #205270
checks-py3

00:03:57

passed #205271
rust-cargo-test-py2

00:02:30

passed #205272
rust-cargo-test-py3

00:02:04

passed #205273
test-py2

00:29:34

passed #205280
test-py2-chg

00:22:44

passed #205275
test-py2-pure

00:24:54

passed #205277
test-py2-rust

00:18:58

failed #205274
test-py3

00:21:56

passed #205281
test-py3-chg

00:08:08

passed #205276
test-py3-pure

00:12:47

passed #205279
test-py3-rhg

00:11:31

passed #205278
test-py3-rust

00:16:27

 
  Phabricator
skipped #205283
phabricator-refresh
 
Name Stage Failure
failed
test-py3 Tests
Skipped test-status.t#dirstate-v2: missing feature: Using the Rust extensions
Skipped test-symlinks.t#dirstate-v1-tree: missing feature: Using the Rust extensions
Skipped test-symlinks.t#dirstate-v2: missing feature: Using the Rust extensions
Skipped test-verify-repo-operations.py: missing feature: allow slow tests (use --allow-slow-tests)
Failed test-manifest.t: output changed
# Ran 906 tests, 77 skipped, 1 failed.
python hash seed: 1153651240
Cleaning up file based variables
ERROR: Job failed: exit code 1