subrepo: clone of git sub-repository creates incorrect git branch (issue3870)

Mercurial handles git subrepos by incorrect way.
If the mercurial repo has a git sub-repo and somebody started
a new branch in the subrepo and push it into git, the next one
who will clone the whole repo will get incorrect branch name in the git
subrepo.
subrepo: add regression test for issue3870
test: use a lighter log style in histedit test

The default log displays a log of information that is useless for
histedit tests. Having a cleaner log help readability of those tests a
lot.

This does not change anything to the test semantic.

--HG--
extra : rebase_source : c28de61959e3912d151b206a48ddc04fef655165
test: improve documentation of some histedit tests

Each test section is clearly separated from the others and gains some
helpful documentation.

--HG--
extra : rebase_source : 90d57a2212ae655d2bd4853c2942b541ebd482af
histedit-test: replace obscure python script by a plain file

One of the tests uses a python script to edit the histedit commands on
the fly. It was hard to read and likely to break. This is replaced by
a plain command file.

Doing so made me discover that the python script is incorrect. The
"+6" regexp never matched because the revision number is wrong.

This error is kept in the replacement for now. Fixing the histedit command
triggers a traceback in histedit.

A later changeset will fix the error and restore the intended test.

--HG--
extra : rebase_source : 7076af979fe772083aaa71e07a3f5f7361660afc
histedit: properly handle --continue on empty fold

When all changes from the fold have been dropped, the --continue code was
confused. This changeset handles this case.

The test for this case existed but was broken.

--HG--
extra : rebase_source : e3ae72066be2088fe50edd86a7338749c0cac23e
histedit: allow "-" as a command file

When "-" is specified as a command file, we read rules from stdin. Alter a
single test to demo the behavior, but most of them could benefit from this.

There is minor change in test output resulting from the fact we no
longer change log messages.

--HG--
extra : rebase_source : be960592a5fb9d0a7c39fe9e642f397826785aa6
histedit-test: generalise --commands "-" usage

This is simpler than temporary file version. There some minor test
changes since commit messages are no longer modifed. There is still
some tests using --commands with a real file.

--HG--
extra : rebase_source : b26eb77b5bcce7c2b5c2eb41f888ab8c1f4838fa
histedit: move all arguments checks to the beginning of the command

This changeset move all checks and raises related to arguments
validation to the top of the file. This gathers all the logic in one
place and clarifies the code doing actual work. This paves the way for
splitting this gigantic function in separated functions.

A `goal` variable is introduced in the process. It holds the action to
be done by this invocation (new, continue or abort).

An invalid invocation is found in the process (the new code is a bit stricter).

--HG--
extra : rebase_source : b96e7e0f39866bcfc12620d9a7b32ec7703c156b
histedit: move outgoing processing to its own function

Every piece of code extracted from the main command is a win. We simplify
changeset determination in the process. Parent ceases being a list before
becoming a node. We how have a root variable containing a node all the time.

--HG--
extra : rebase_source : 8db03dc3e94cb75ee5ab59d45392950df752b5e9
tests: run check-code on Python files without .py extension
codingstyle: remove trailing spaces in various text files

Better do it once than see random changes in diffs later.
amend: fix unlocking order - first lock then wlock
import: factor out checkexact

The two calls are strictly identical. We can simply move it after the if/else
clause.

--HG--
extra : histedit_source : 9d42bbd12d4340f81f080913d44f9fd212c6f30f
import: inline checkexact function

We have a sngle call now, no need to make it a function.

--HG--
extra : histedit_source : 66fdcdc7cb399d62bb7bcc4115df3a79c89196e8
transplant: clarify what --branch do - it has nothing to do with branches

--branch specifies heads and has nothing to do with named branches, and it only
deals with topological branches to the same extent as all other DAG operations
do.

--HG--
extra : histedit_source : 9f0230608d691c6a70ef5e76a872247711411f30
transplant: improve documentation

--HG--
extra : histedit_source : 98b41d1712839d4321910605cf3679c415b9646c
zsh_completion: complete all files for `commit/backout --logfile`

Up until now commit/backout `--logfile` option was completed only with
*.txt-files. This requirement is a bit too strong (and is nowhere to be stated)
so it's better to complete with all files.

Stolen from zsh.git repo, c5fce37b changeset by Oliver Kiddle.
parsers: fix variable declaration position issue

--HG--
extra : rebase_source : 71352b694022aa3b7d2a0e981b890c46256859b0