Can Mercurial Detect and Handle Expired SSH or HTTP Credentials Without Requiring a New Connection?
0 reputation · 23 Nov 2021, 02:05 UTC
The goal is to understand whether Mercurial can react to credential expiration that occurs during a long‑running operation such as a large push or pull, given that it delegates authentication to the underlying SSH or HTTP transport.
Mercurial itself does not enforce credential expiration; it relies on the transport layer to reject expired credentials, and its hooks (e.g., pretxnchangegroup) are invoked only after the transport authentication succeeds. This raises uncertainty about whether any mechanism exists to anticipate or mitigate an impending credential failure before the transport aborts the connection.
Does Mercurial provide a way to inspect credential validity prior to invoking a transport operation? Can a hook be configured to validate credential freshness without waiting for a transport‑level error? Is there any planned or experimental feature that would allow Mercurial to trigger a credential refresh mid‑session?