Mercurial Repository Hosting

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up mercurial repository hosting by running a central server over SSH or HTTPS. Your team then pushes and pulls code changes through that shared server endpoint. Most teams start with a single shared host and basic user groups. They grant read and write roles to whole engineering groups at once. Broad roles let any user change critical branches or read sensitive config files. One bad push can break the main build for the whole company. How mercurial repository hosting works in practice

Repository Hosting: the complete guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free white paper. No spam. Unsubscribe anytime.

You set up mercurial repository hosting by running a central server over SSH or HTTPS. Your team then pushes and pulls code changes through that shared server endpoint. Most teams start with a single shared host and basic user groups. They grant read and write roles to whole engineering groups at once. Broad roles let any user change critical branches or read sensitive config files. One bad push can break the main build for the whole company.

How mercurial repository hosting works in practice

Mercurial stores every project as a set of tracked changesets inside a hidden folder. When you host a repo, a web process or SSH service listens for requests. A developer runs a push or pull command from a local machine. The server checks the user key or password before it allows the transfer. If the check passes, both sides compare their history graphs to find missing revisions. The client then sends or receives a compressed bundle of those exact changes.

Teams choose between two main transport protocols when they set up a central server. SSH transport uses operating system accounts or a shared service user with public keys. A special wrapper script reads the key and maps it to a repo path. HTTPS transport runs through a standard web server that calls the Mercurial web script. The web server handles TLS encryption and checks user logins against a password directory. Both methods rely on server-side hooks to enforce custom rules during a push.

Choosing between self-hosted servers and cloud platforms

Many large codebases still rely on Mercurial for its fast handling of huge monorepos. Still, major cloud hosts have dropped support for Mercurial over the past few years. Teams must now pick specialized source hosts or run their own server instances. Self-hosting gives you full control over disk speed, network rules, and backup schedules. You can place the server close to your build workers to speed up clones.

Managed hosting platforms take away the burden of patching operating systems and web servers. They provide built-in web views for code review, issue tracking, and branch permissions. Yet managed tools may limit which server hooks or custom extensions your team runs. You must weigh the cost of server maintenance against the need for custom workflows.

Repository Hosting: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

What native server permissions solve and what they miss

Native server settings let you control who can log in and reach each repo. You can map user groups to specific project folders on the host machine. Server hooks can also block pushes to protected branches if a user lacks permission. These controls stop unknown users from reading your source code or pushing bad changes. They form the basic security boundary for any shared source control system.

Still, static server roles only decide who gets through the front door at login. Once a developer or build worker connects, that session holds full standing privileges. Native repo permissions do not inspect live admin commands run on the host machine. They also leave long-lived SSH keys sitting on developer laptops and build nodes. If an attacker steals a key, they gain silent access to every allowed repo. Teams also lack a clear audit log when admins log in to fix broken repos.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

Should we use SSH or HTTPS for mercurial repository hosting?

SSH works well for teams that already manage public keys across their developer machines. HTTPS is often easier to pair with single sign-on directories and corporate firewalls.

How do server hooks protect main branches during a push?

A pre-commit hook runs on the server right before it accepts incoming changesets. The script checks the author, branch name, or commit message and rejects bad pushes.

How can we speed up clones on a large Mercurial monorepo?

You can enable clone bundles on the server to pre-package the full repo history. Clients download this static bundle fast over a content network before pulling recent changes.

Save the open-source gateway.

hoop is MIT-licensed infrastructure for controlling how AI agents reach production data. Star hoophq/hoop so you can inspect it, deploy it, or share it when your team starts governing agent access.