A Mercurial proxy can remain the default for external repositories while internal hosts go direct. For a public HTTP route, choose the host and port from the HTTP proxy list for the default endpoint:

[http_proxy]
host = proxy.example:8080
no = hg.internal.example,localhost
always = false

The no value is a comma-separated hostname list. Mercurial documents always=true as forcing proxy use even for localhost and entries in that list. Adding a host to no while retaining that override can therefore leave its route unchanged.

For one invocation, override the relevant values without rewriting the configuration:

hg --config http_proxy.always=false    --config http_proxy.no=hg.internal.example incoming

The repository’s configured default path must actually name that host. This example replaces the no value for the command; include other required entries if that invocation needs them too.

Use hg config --source to locate the effective settings when user, repository and system configuration disagree. Remove passwords before sharing that output.

These controls apply to web-based repository access. An ssh:// repository uses another transport. Direct HTTP routing also still needs a network path and the repository’s own credentials.

Mikanda mikatakata