config: exit non zero on non-existent config option (issue4247)

When running 'hg config no_such_option', hg exited with a
zero exit code. This change now exits with a 1 if the
config option does not exist.

--HG--
branch : stable
merge with stable
merge with stable
revert: add a way for external extensions to prefetch file data

This allow extensions that mess with the storage layer (remotefilelog,
largefile) to prefetch any data that will be accessed during the revert
operation.

We are currently fetching more data than theoretically required because the
backup code is a bit stupid. Future patches will improve that.
revert: add documentation in the dispatch table

More sets are coming so documenting the existing ones will help.
revert: add more padding in the dispatch list

We are going to add more sets and some of them will have longer names. We add
padding in a standalone patch for readbility purposes.
revert: no backup for `dsadded` set

There is only one case where a backup is required in the `dsadded` set, and the
current backup mechanism fails to handle it. So we stop trying to do backups at
all for now. This will help us to simplify the backup code and finally fix
this backup issue.
revert: drop now useless conditional in the backup check

Now that we removed the (hopeless) attempt to backup file we knew to be
missing in the target changeset, we can stop checking if the file exists in
the target changeset.
i18n-pt_BR: synchronized with 0c838e7459a5

--HG--
branch : stable
repoview: fix typo in repoview.changelog

Incidentally, this avoids the changelog cache being invalidated each time
it's accessed on a repoview.

On a filtering experiment on a repository the size of mozilla-central,
this makes a significant difference:

Before, running hg log -l 10 --time with about 8k changesets filtered out:
time: real 1.490 secs (user 1.450+0.000 sys 0.040+0.000)

After:
time: real 0.540 secs (user 0.530+0.000 sys 0.010+0.000)

--HG--
branch : stable
help: only call doc() when it is callable

`hg help -k` on my machine was aborting because the hg-prompt extension
was inserting a string and not a function into help.helptable and help
was blindly calling it.

This patch changes keyword searching to be more robust against
unexpected types.

--HG--
branch : stable
i18n-ja: synchronized with 0c838e7459a5

--HG--
branch : stable
merge with i18n

--HG--
branch : stable
i18n-pt_BR: synchronized with 6a8b8efb0641

--HG--
branch : stable
merge with i18n

--HG--
branch : stable
Added tag 3.1.1 for changeset 5dc91146f353

--HG--
branch : stable
Added signature for changeset 5dc91146f353

--HG--
branch : stable
build: don't clean __version__.py on 'make clean' in release tarballs

When running 'make clean' in an extracted release tarball, file
mercurial/__version__.py is removed, causing a subsequent install to
indicate 'version unknown'.

This problem was reported in the past [1] and a patch proposed in that mail,
but was never properly sent nor applied.

[1] http://selenic.com/pipermail/mercurial/2010-December/036249.html
histedit: abort gracefully on --continue/--abort with no state

Previously we'd print an ugly message saying that the histedit-state file
doesn't exist in the repo.

--HG--
branch : stable
extra : rebase_source : 35e529b98331d2ef9620262bed40674e09364b56
dispatch: make "_checkshellalias" reusable regardless of adding aliases

To reduce changes in the subsequent patch fixing issue4355, this patch
makes "_checkshellalias" reusable regardless of adding aliases.

In this patch, alias definitions are added and restored, only when
"precheck=True".

--HG--
branch : stable