https+auth: use a ~/.git-credentials file if it exists to fetch credentials

In some situations we code the plain auth-less uri in the hgrc paths
section (for convenience) and want to use a centrally-stored
credentials file.

Though it is possible to use the hgrc [auth] section, it would be also
nice to access .git-credentials (still usefull for git direct access),
avoiding double maintenance of credentials.

This probably does not cover all possible situations with git
credentials handling (a vast topic) but it provides a working
base.

closes 305
demandimport: add 'brotli' to ignores, so urllib3 can detect its absence

Pushing to GitHub fails under Python 2.7 without this.

https://foss.heptapod.net/mercurial/hg-git/-/issues/326
overlay: support {gitnode} keyword in templates for incoming changes

Fixes #239.
debuggitdir: add new command

This is useful for interacting with the Git repository directly,
either from shell scripts, the terminal, or perhaps an alias like
this:

[alias]
git=!GIT_DIR=$(hg debuggitdir) git "$@"

...and with that, you can easily access features not offered by
Dulwich such as `hg git gc`.
gclear: just use shutil.rmtree()
gclear: remove tags file as well
gclear: add test checking that it actually clears everything
git_handler: use `self.ui.paths` instead of directly interpreting config

This correctly handles sub-options. Before, the test case failed with:
dulwich.errors.RefFormatError: refs/remotes/default:pushurl/beta
git_handler: support file URIs for remotes

Before, the added test case failed with “abort: git remote error: fatal:
'file://$TESTTMP/gitrepo' does not appear to be a git repository”.
ci: use images from local registry
tags: mark tags and remote references as pinned in repoview
test-git-tags: test amending commits
74fea2f30ac8 — Tristan Seligmann 2 years ago
tests: silence git pull warning

Pass --ff-only to git pull to avoid a warning.
suppress the one warning given by pyflakes
synchronise run-tests.py with latest version from stable mercurial

Copied from changeset 5a19d7c9129b in the stable branch, latest as of
2020-10-11.

https://www.mercurial-scm.org/repo/hg/rev/5a19d7c9129b
71dab394b018 — Tristan Seligmann 2 years ago
tests: pass messages to git merge

Pass explicit messages to git merge to avoid relying on the default.
optimise writing the map file

We currently write the map file to a BytesIO buffer, and _then_ write
it to an atomic temporary file. However, the file is opened for atomic
write, so the extra buffering doesn't really add anything other than
overhead.
push: address a deprecation in dulwich 0.20.6
import: _always_ save the map after an import

Pulls aren't done in a transaction, so you can safely interrupt them,
and get a partial result. Unfortunately, the commit map isn't updated,
so once you resume the pull, it'll begin at the start at same commit as
last, rather than where interrupted.

With this tiny change, I can interrupt and resume long-running pulls
at leisure.

There's no test, since writing the required infrastructure seems a bit
overkill.
gitnodekw: do not crash on hg incoming when log template includes gitnode()

Before this change, if the user's log template included a call to gitnode() to
show the git commit hash, invoking "hg incoming" on a git repository that had at
least one incoming change failed with:

   AttributeError: 'overlayrepo' object has no attribute 'githandler'

Since an incoming changeset should already have well defined git commit hashes,
there is no apparent reason for which "hg incoming" should not have this
information already.

This change is a workaround that removes any reference to the hg-git structures
from the incoming changeset, thus merely avoiding the crash.

Fixes #239 (https://foss.heptapod.net/mercurial/hg-git/-/issues/239)
Next